Changeset 5749372 in mainline
- Timestamp:
- 2008-08-10T00:49:49Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2dd7288
- Parents:
- 8f2a852
- Location:
- tools
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/xstruct.py
r8f2a852 r5749372 37 37 38 38 def pack(self): 39 list = [] 40 for variable in self._list_: 41 list.append(self.__dict__[variable]) 39 args = [] 40 for variable in self._args_: 41 if (isinstance(self.__dict__[variable], list)): 42 for item in self.__dict__[variable]: 43 args.append(item) 44 else: 45 args.append(self.__dict__[variable]) 42 46 43 return struct.pack(self._format_, * list)47 return struct.pack(self._format_, *args) 44 48 45 49 def create(definition): … … 55 59 }[tokens[0]]() 56 60 inst = Struct() 57 list= []61 args = [] 58 62 59 63 # Member tags … … 79 83 80 84 inst.__dict__[subtokens[0]] = None 81 list.append(subtokens[0])85 args.append(subtokens[0]) 82 86 83 87 variable = None … … 103 107 104 108 inst.__dict__['_format_'] = format 105 inst.__dict__['_ list_'] = list109 inst.__dict__['_args_'] = args 106 110 return inst
Note:
See TracChangeset
for help on using the changeset viewer.