Changeset 190 for trunk/src


Ignore:
Timestamp:
05/14/09 13:11:08 (15 years ago)
Author:
bas
Message:

src/PBSQuery.py:

  • fixed an error in parsing for new data structure, value can contain a '=' char
  • added the iter method

examples/new_interface.py:

  • make use of new data structure and iter object
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PBSQuery.py

    r188 r190  
    180180                                                        new[key] = dict()
    181181                                                        for v in values:
    182                                                                 a,b = v.split('=')
    183                                                                 new[key][a] = [ b ]
     182                                                                # First argument is the key and the rest is the value
     183                                                                # - value can contain a '='
     184                                                                #
     185                                                                tmp = v.split('=')
     186                                                                new[key][ tmp[0] ] = [ tmp[1:] ]
    184187                                               
    185188                self._free(l)
     
    318321                        error = 'invalid attribute %s' %(name)
    319322                        raise PBSError(error)
     323
     324        def __iter__(self):
     325                return iter(self.data.keys())
    320326
    321327        def uniq(self, list):
Note: See TracChangeset for help on using the changeset viewer.