Esempio n. 1
0
 def _create_op_parameters(self, opmodel_xml, name, opObj):
     opparam_xml = ''
     if _opcallable(opObj) == 'class':
         pmds = init_sig = _inspect.signature(opObj._splpy_wrapped.__init__).parameters
         itpmds = iter(pmds)
         # first argument to __init__ is self (instance ref)
         next(itpmds)
     
         for pn in itpmds:
             pmd = pmds[pn]
             _valid_op_parameter(pn)
             px = _OP_PARAM_TEMPLATE
             px = px.replace('__SPLPY__PARAM_NAME__SPLPY__', pn)
             px = px.replace('__SPLPY__PARAM_OPT__SPLPY__', 'false' if pmd.default== _inspect.Parameter.empty else 'true' )
             opparam_xml = opparam_xml + px
     replaceTokenInFile(opmodel_xml, '__SPLPY__PARAMETERS__SPLPY__', opparam_xml)
Esempio n. 2
0
 def _create_op_parameters(self, opmodel_xml, name, opObj):
     opparam_xml = ''
     if _opcallable(opObj) == 'class':
         pmds = init_sig = _inspect.signature(opObj._splpy_wrapped.__init__).parameters
         itpmds = iter(pmds)
         # first argument to __init__ is self (instance ref)
         next(itpmds)
     
         for pn in itpmds:
             pmd = pmds[pn]
             _valid_op_parameter(pn)
             px = _OP_PARAM_TEMPLATE
             px = px.replace('__SPLPY__PARAM_NAME__SPLPY__', pn)
             px = px.replace('__SPLPY__PARAM_OPT__SPLPY__', 'false' if pmd.default== _inspect.Parameter.empty else 'true' )
             opparam_xml = opparam_xml + px
     replaceTokenInFile(opmodel_xml, '__SPLPY__PARAMETERS__SPLPY__', opparam_xml)