Changeset 14254 for fact/tools/PyDimCtrl


Ignore:
Timestamp:
07/10/12 07:38:22 (12 years ago)
Author:
neise
Message:
evolving
Location:
fact/tools/PyDimCtrl
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/PyDimCtrl/factdimserver.py

    r13814 r14254  
    185185# and since _get() has a return value, this return value is vorwarded to the user
    186186def 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')
    188195    if iskeyword(meth_name):
    189196        meth_name += '_cmd'
     
    247254        # sl_raw is a tuple, with an really long string, which needs to be parsed
    248255        sl_raw = pydim.dic_sync_info_service(server+'/SERVICE_LIST','C')[0]
    249        
     256#        print server
     257#        print sl_raw
    250258        # even without parsing, I can find out, if this server also gives me a
    251259        # service description list. In case it does not, this is fine as well
     
    281289        for d_str in sd:
    282290            service,equalsign,desc = d_str.partition('=')
     291            if not '/' in service:
     292                service = server+'/'+service
    283293            #if '=' != equalsign:
    284294                # print "Error: server:", server, "desc:", d_str
     
    309319            types.ClassType( server_name, (FactDimServer,), {}) )
    310320    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')
    311330        if 'CMD' in services[server_name][cmd][1]:
    312             cmdname = cmd.split('/')[1]
    313331            add_command(FactDimServerClasses[-1], cmd)
    314332        elif not services[server_name][cmd][1]:
    315             cmdname = cmd.split('/')[1]
    316333            add_getter(FactDimServerClasses[-1], cmd)
    317334
Note: See TracChangeset for help on using the changeset viewer.