当前位置: 首页>>代码示例>>Python>>正文


Python CompositeNode.configure方法代码示例

本文整理汇总了Python中mpx.lib.node.CompositeNode.configure方法的典型用法代码示例。如果您正苦于以下问题:Python CompositeNode.configure方法的具体用法?Python CompositeNode.configure怎么用?Python CompositeNode.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mpx.lib.node.CompositeNode的用法示例。


在下文中一共展示了CompositeNode.configure方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     # get handle to ARM in arm.py.  
     # self.coprocessor is the surrogate parent this child.
     # 
     set_attributes(self, (('id',REQUIRED),('coprocessor',REQUIRED)), config)
     self._coprocessor = self.coprocessor._coprocessor # the moab megatron ARM object
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:node.py

示例2: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, cd):
     CompositeNode.configure(self, cd)
     set_attribute(self, 'source',self.source, cd, str)
     set_attribute(self, 'device_link', None, cd, str) #url of Devices node
     set_attribute(self, 'discover_mode', self.discover_mode, cd, str)
     set_attribute(self, '__node_id__',self._node_id, cd, str)
     set_attribute(self, 'bacnet_datatype', 'real', cd, str)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:bacnet_scheduler.py

示例3: test_configure_sequence

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def test_configure_sequence(self):
     p = PeriodicLog()
     p.configure({'name':'log','parent':None, 'period':1})
     h = CompositeNode()
     h.configure({'name':'columns','parent':p})
     c = PeriodicAverageColumn()
     c.configure({'position':0, 'name':'2', 'parent':h,
                  'function':self._next})
     p.start()
     try:
         l = []
         v = []
         for i in range(0,100):
             l.append(c._evaluate())
             v.append(i-0.5)
         if l.pop(0) != None:
             raise 'First delta not None.'
         v.pop(0)
         for i in l:
             j = v.pop(0)
             if i != j:
                 raise 'Incorrect average of %s should be %s.' % (i, j)
     finally:
         p.stop()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:27,代码来源:_test_case_periodic_average_column.py

示例4: test_configure_sequence_get

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def test_configure_sequence_get(self):
     p = PeriodicLog()
     p.configure({'name':'log','parent':None, 'period':1})
     h = CompositeNode()
     h.configure({'name':'columns','parent':p})
     c = PeriodicDeltaColumn()
     c.configure({'position':0, 'name':'2', 'parent':h,
                  'function':self._next})
     p.start()
     try:
         l = []
         if c.get() != None:
             raise 'Get didn\'t return None on first get'
         if c.get() != None:
             raise 'Get didn\'t return None on second get'
         self.seq.value = 0
         c.function()
         self._next()
         self._next()
         self._next()
         if c.get() != self.seq.value - 1:
             raise 'Got incorrect value after incrementing'
     finally:
         p.stop()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:27,代码来源:_test_case_periodic_delta_column.py

示例5: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     set_attribute(self,'debug', debug, config, as_boolean)
     set_attribute(self,'post',REQUIRED,config, str)
     set_attribute(self,'server',REQUIRED, config, str)
     set_attribute(self,'action',REQUIRED, config, str)
     set_attribute(self,'ttl',1.0, config, float)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:device.py

示例6: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self,config):
     CompositeNode.configure(self,config)
     set_attribute(self, 'port', 502, config, int)
     set_attribute(self, 'debug', 0, config, int)
     self.udp_port = self.port
     self.port = self #intercept any calls to the port
     return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:tcp_ip_server.py

示例7: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self,config)
     set_attribute(self, 'id', 0, config, str)
     set_attribute(self,'cache_life',30,config,float)
     set_attribute(self,'timeout',10,config,float)
     set_attribute(self,'patience',1,config,float)
     self.port = self.parent
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:__init__.py

示例8: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     set_attribute(self, 'url', '', config, str)
     set_attribute(self, 'user', '', config, str)
     set_attribute(self, 'password', '', config, str)
     set_attribute(self, 'spreadsheet', self.name, config, str) #spreadsheet name
     set_attribute(self, 'worksheet', '', config, str)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:spreadsheet.py

示例9: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     set_attribute(self, 'address', REQUIRED, config, int)
     set_attribute(self, 'line_handler', self.parent, config, as_node)
     for key in _register_map:
         node = _register_map[key][0]()
         node.configure({'parent':self,'register':key,'name':_register_map[key][1],'multiplier':_register_map[key][2]})
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:egcp2.py

示例10: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     set_attribute(self, 'ion', self.parent, config, as_node)
     if not self.ion:
         self.ion = self.parent
     if hasattr(self, '_mutate'):
         self._mutate()
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:_translator.py

示例11: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     # Deal with UDI voodoo.  Basically, if use param is a dict,
     # then use the DM to assign an instance.  If it's a UDI, don't.
     self.device_manger = self.parent.device_manger
     # UDI configuration is a bit magical.  If this node is dynamically
     # instanciated, then the UDI exists AND we  could be being called by
     # the DeviceManager in a manner that is not conducive to reentrancy...
     udi = config.get('udi', None)
     if udi is not None and self.udi is None:
         if isinstance(udi, UniqueDeviceIdentifier):
             # Implies dynamic configuration, the UDI exists.
             # @note Dynamic Monitor creation occurs in the DeviceManager
             #       and the implementation is not conducive reentering
             #       the DeviceManager (think deadlock).
             self.udi = udi
         else:
             # Implies static configuration.  *The* UDI should not exist, or
             # at least it should not reference a monitor yet.  Create *the*
             # UDI and associate it with this monitor.
             assert isinstance(udi, dict)
             self.udi = udi
             self.device_manger.register_monitor(self)
             self.udi = self.device_manger.udi_from_udi(udi)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:27,代码来源:monitor.py

示例12: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self,config):
     if self.debug:
         msglog.log('EnergywiseManager:', msglog.types.INFO,
                    'Inside configure' )
     CompositeNode.configure(self, config)
     set_attribute(self, 'debug', 0, config, int)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:energywise_manager.py

示例13: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self,config):
     CompositeNode.configure(self,config)
     set_attribute(self,'points',REQUIRED,config)
     # self._points will later be built in same order.
     # this needs to be done here so that parent's start
     # doesn't have to happend before my start is called.
     for point in self.points:
         self.meta['names'].append(point['name'])
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:group_log.py

示例14: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     self.soapurl = config.get('soapurl')
     self.prefixnamespaces = config.get('prefixnamespaces', False)
     if isinstance(self.prefixnamespaces, str):
         self.prefixnamespaces = eval(self.prefixnamespaces)
     self.soapaction = config.get('soapaction')
     self.namespace = config.get('namespace')
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:node.py

示例15: configure

# 需要导入模块: from mpx.lib.node import CompositeNode [as 别名]
# 或者: from mpx.lib.node.CompositeNode import configure [as 别名]
 def configure(self, config):
     CompositeNode.configure(self, config)
     set_attribute(self, 'PID', REQUIRED, config, str)
     set_attribute(self, 'description', self.description, config, str)
     set_attribute(self, 'format', REQUIRED, config, str)
     set_attribute(self, 'properties', self.properties, config, str)
     set_attribute(self, 'ttl', self.ttl, config, float)
     set_attribute(self, 'scale', self.scale, config, float)
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:cat_nodes.py


注:本文中的mpx.lib.node.CompositeNode.configure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。