Ignore:
Timestamp:
7 Feb 2009, 14:36:04 (16 years ago)
Author:
uli
Message:

Fix import/export stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/utils/importexport.py

    r3856 r3932  
    4141
    4242
    43 ts_regexp = re.compile('^<type (.*)>$')
     43ts_regexp = re.compile('^<((type)|(class)) (.*)>$')
    4444def getTypeString(obj):
    4545    type_str = str(type(obj))
    4646    m = ts_regexp.match(type_str).groups()
    47     return m[0][1:-1]
     47    return (m[0], m[3][1:-1])
    4848   
    4949
     
    8282            if name.startswith('_'):
    8383                continue
    84             val = unicode(getattr(obj, 'name'))
    85             type_name = getTypeString(getattr(obj, 'name'))
     84            val = unicode(getattr(obj, name))
     85            type_type, type_name = getTypeString(getattr(obj, name))
     86            if type_type not in ['type',]:
     87                # XXX: if type_type == 'class', we should deliver an object.
     88                continue
    8689            newnode = self.doc.createElement('attribute')
    8790            newnode.setAttribute('name', name)
Note: See TracChangeset for help on using the changeset viewer.