Changeset 14254 for fact/tools/PyDimCtrl
- Timestamp:
- 07/10/12 07:38:22 (12 years ago)
- Location:
- fact/tools/PyDimCtrl
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/PyDimCtrl/factdimserver.py
r13814 r14254 185 185 # and since _get() has a return value, this return value is vorwarded to the user 186 186 def add_getter(cls, name): 187 meth_name = name.split('/')[1].lower() 187 meth_name = name.split('/') 188 if len(meth_name) > 1: 189 meth_name = meth_name[1].lower() 190 elif len(meth_name) >0: 191 meth_name = meth_name[0].lower() 192 else: 193 print 'add_getter, cannot parse name:', name 194 raise ValueError('read above') 188 195 if iskeyword(meth_name): 189 196 meth_name += '_cmd' … … 247 254 # sl_raw is a tuple, with an really long string, which needs to be parsed 248 255 sl_raw = pydim.dic_sync_info_service(server+'/SERVICE_LIST','C')[0] 249 256 # print server 257 # print sl_raw 250 258 # even without parsing, I can find out, if this server also gives me a 251 259 # service description list. In case it does not, this is fine as well … … 281 289 for d_str in sd: 282 290 service,equalsign,desc = d_str.partition('=') 291 if not '/' in service: 292 service = server+'/'+service 283 293 #if '=' != equalsign: 284 294 # print "Error: server:", server, "desc:", d_str … … 309 319 types.ClassType( server_name, (FactDimServer,), {}) ) 310 320 for cmd in services[server_name]: 321 cmdname = cmd.split('/') 322 if len(cmdname) > 1: 323 cmdname = cmdname[1] 324 elif len(cmdname) >0: 325 cmdname = cmdname[0] 326 cmd = server_name+'/'+cmdname 327 else: 328 print server_name, cmd 329 raise ValueError('was not able to parse service/command names') 311 330 if 'CMD' in services[server_name][cmd][1]: 312 cmdname = cmd.split('/')[1]313 331 add_command(FactDimServerClasses[-1], cmd) 314 332 elif not services[server_name][cmd][1]: 315 cmdname = cmd.split('/')[1]316 333 add_getter(FactDimServerClasses[-1], cmd) 317 334
Note:
See TracChangeset
for help on using the changeset viewer.