Changeset 205
- Timestamp:
- 11/12/09 15:43:13 (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AUTHORS
r181 r205 6 6 7 7 PBSQuery module: 8 Roy Dragseth9 8 Bas van der Vlies 10 9 … … 14 13 Dennis Stam 15 14 Sil Westerveld 15 Roy Dragseth -
trunk/CHANGES
r196 r205 1 =========== 3.2.5 2 - PBSQuery 3 The class function of node, job and queue support old and new data structure. 4 Author: Bas van der Vlies 1 =========== 3.5.0 2 * PBSQuery 3 The class functions of node, job and queue support old and new data 4 structure. 5 6 Changed the behaviour of the new data stucture, We can use it as 7 dictionary and as class attribute, this is equivalent, eg: 8 - print node['np'] and print node.np 9 10 for a node we parse the 'status' line and split on '=' char, You now can 11 use these statements, eg 12 - print node.status.arch (node['status'].arch or node['status']['arch']) 13 - print node.status.nsession 14 15 for a job we parse the 'Variable_List' line and split on '=' char, You now can 16 use the statements, eg: 17 - print job.Variable_List.PBS_O_WORKDIR 18 - print job.Variable_List.PBS_O_HOME 19 20 For more info see examples/new_interface.py 21 22 Author: Bas van der Vlies 23 24 * new_rack_pbsmon.py 25 Rewrite to new data structure and automatically determine how many nodes 26 and racks cluster has and skip printing of empty racks (default), use -w/--wide 27 for old behaviour. 28 29 Author: Bas van der Vlies 30 5 31 6 32 =========== 3.2.0 -
trunk/debian/changelog
r203 r205 1 pbs-python (3. 2.5-2) intrepid; urgency=low1 pbs-python (3.5.0-1) lenny; urgency=low 2 2 3 3 * PBSQuery 4 The class function of node, job and queue support old and new data4 The class functions of node, job and queue support old and new data 5 5 structure. 6 7 Changed the behaviour of the new data stucture, We can use it as 8 dictionary and as class attribute, this is equivalent, eg: 9 - print node['np'] and print node.np 10 11 for a node we parse the 'status' line and split on '=' char, You now can 12 use these statements, eg 13 - print node.status.arch (node['status'].arch or node['status']['arch']) 14 - print node.status.nsession 15 16 for a job we parse the 'Variable_List' line and split on '=' char, You now can 17 use the statements, eg: 18 - print job.Variable_List.PBS_O_WORKDIR 19 - print job.Variable_List.PBS_O_HOME 20 21 For more info see examples/new_interface.py 22 6 23 Author: Bas van der Vlies 7 24 … … 13 30 Author: Bas van der Vlies 14 31 15 -- Bas van der Vlies <bas@rc.sara.nl> Mon, 1 8 May 2009 17:03:16 +020032 -- Bas van der Vlies <bas@rc.sara.nl> Mon, 12 Nov 2009 15:03:16 +0200 16 33 17 34 pbs-python (3.2.0-1) intrepid; urgency=low -
trunk/src/PBSQuery.py
r195 r205 131 131 values contain a '=' character 132 132 133 133 eg: 134 134 print node['np'] 135 135 >> [ '2' ] … … 144 144 self.d[item.name] = new 145 145 146 new.name = item.name 146 new.name = item.name 147 147 148 148 for a in item.attribs: 149 149 150 if a.resource:151 key = '%s.%s' %(a.name, a.resource)152 else:153 key = a.name154 155 150 if self.OLD_DATA_STRUCTURE: 151 152 if a.resource: 153 key = '%s.%s' %(a.name, a.resource) 154 else: 155 key = '%s' %(a.name) 156 156 157 new[key] = a.value 158 157 159 else: 158 160 values = string.split(a.value, ',') 159 160 if len(values) == 1: 161 # simple form 162 # print 'simple %s = %s' %(key, values[0]) 161 sub_dict = string.split(a.value, '=') 162 163 164 if len(sub_dict) > 1: 165 # We must creat sub dict, only for specified 166 # key values 163 167 # 164 new[key] = values 165 166 else: 167 # list check 168 list_or_dict = string.split(a.value, '=') 169 170 171 if len(list_or_dict) == 1: 172 # This is a list 173 # print 'list %s = %s' %(key, values) 168 if a.name in ['status', 'Variable_List']: 169 170 for v in values: 171 172 tmp_l = v.split('=') 173 174 # Check if we already added the key 175 # 176 if new.has_key(a.name): 177 new[a.name][ tmp_l[0] ] = tmp_l[1:] 178 179 else: 180 tmp_d = dict() 181 tmp_d[ tmp_l[0] ] = tmp_l[1:] 182 new[a.name] = class_func(tmp_d) 183 184 else: 185 # Check if it is a resource type variable, eg: 186 # - Resource_List.(nodes, walltime, ..) 187 # 188 if a.resource: 189 190 if new.has_key(a.name): 191 new[a.name][a.resource] = values 192 193 else: 194 tmp_d = dict() 195 tmp_d[a.resource] = values 196 new[a.name] = class_func(tmp_d) 197 else: 198 # Simple value 174 199 # 175 new[key] = values 176 177 else: 178 # This is dictionary 179 # print 'dict %s = %s' %(key, values) 180 # 181 new[key] = dict() 182 for v in values: 183 # First argument is the key and the rest is the value 184 # - value can contain a '=' 185 # 186 tmp = v.split('=') 187 new[key][ tmp[0] ] = tmp[1:] 188 200 new[a.name] = values 201 189 202 self._free(l) 190 203 … … 309 322 FALSE = 0 310 323 311 def __init__(self ):324 def __init__(self, dictin = None): 312 325 UserDict.UserDict.__init__(self) 313 326 self.name = None 327 328 if dictin: 329 if dictin.has_key('name'): 330 self.name = dictin['name'] 331 del dictin['name'] 332 self.data = dictin 314 333 315 334 def get_value(self, key): … … 329 348 return self.data[name] 330 349 except KeyError: 331 error = ' invalid attribute%s' %(name)350 error = 'Attribute key error: %s' %(name) 332 351 raise PBSError(error) 333 352 -
trunk/src/pbs.py
r197 r205 534 534 Returns the pbs python interface version as a string. 535 535 """ 536 return '3. 2.5'536 return '3.5.0' 537 537 538 538 # A useful dict with error codes to text
Note: See TracChangeset
for help on using the changeset viewer.