本文整理汇总了Python中mpx.lib.node.ConfigurableNode.configure方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigurableNode.configure方法的具体用法?Python ConfigurableNode.configure怎么用?Python ConfigurableNode.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpx.lib.node.ConfigurableNode
的用法示例。
在下文中一共展示了ConfigurableNode.configure方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, config):
"""method configure(): Called by MFW."""
self.debug_print('Starting configuration...', 0)
ConfigurableNode.configure(self, config)
self.debug_print('Configuration complete.', 0)
示例2: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self,config):
ConfigurableNode.configure(self, config)
message = ''
if not (config.has_key('message') and config['message']):
for var in self.variables:
if message:
message += ', '
message += '%s = ${%s}' % (var['vn'],var['vn'])
set_attribute(self, 'message', message, {})
else:
set_attribute(self, 'message', REQUIRED, config)
set_attribute(self, 'subject', '', config, str)
set_attribute(self, 'send_retries', 3, config, int)
set_attribute(self, 'enabled', 1, config, as_boolean)
set_attribute(self, 'prodnode', '', config, str)
set_attribute(self, 'eventmodule', '', config, str)
set_attribute(self, 'eventclass', '', config, str)
set_attribute(self, 'debug', 0, config, int)
self._event_class = None
# Try to import our specified event class.
try:
x = __import__(self.eventmodule, {}, {}, self.eventclass)
self._event_class = eval('x.%s' % self.eventclass)
except:
msglog.log('broadway',msglog.types.WARN,
'Got exception trying to import event class.')
msglog.exception()
self._manager = self.parent.parent
示例3: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure( self, config ):
set_attribute( self, 'enable', 0, config, int )
set_attribute( self, 'user_id', '', config )
set_attribute( self, 'password', '', config )
set_attribute( self, 'local_ip', '', config )
set_attribute( self, 'client_ip', '', config )
set_attribute( self, 'debug', 0, config, int )
ConfigurableNode.configure( self, config )
示例4: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, config):
"""method configure(): Called by MFW."""
self.debug_print('Starting configuration...', 0)
ConfigurableNode.configure(self, config) # includes addition of "parent" attr
try:
self.parent.open()
except termios.error, details:
print 'termios.error: %s.' % str(details)
示例5: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure( self, config_dict ):
ConfigurableNode.configure( self, config_dict )
set_attribute( self, 'enable', 0, config_dict, int )
set_attribute( self, 'debug', 0, config_dict, int )
set_attribute( self, 'ddns_service', 0, config_dict )
set_attribute( self, 'ddns_acct', 0, config_dict )
set_attribute( self, 'ddns_pswd', 0, config_dict )
set_attribute( self, 'host_name', 0, config_dict )
map_to_attribute( self, 'period', 0, config_dict, map_to_seconds )
示例6: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, config):
set_attribute(self, 'debug', self.debug, config, int)
self._init_debug()
self.DEBUG3("configure(%r):\n", config)
ConfigurableNode.configure(self, config)
self._url = as_node_url(self)
if self.output is REQUIRED:
self.output = self.parent
set_attribute(self, 'output', self.parent, config, self.as_deferred_node)
set_attribute(self, 'input', REQUIRED, config, self.as_deferred_node)
set_attribute(self, 'period', self.period, config, float)
set_attribute(self, 'asyncOK', self.asyncOK, config, int)
# in cov mode, only changing values are driven.
set_attribute(self, 'cov_mode', self.cov_mode, config, int)
set_attribute(self, 'enabled', 1, config, as_boolean)
set_attribute(self, 'backoff_on_failure', 0, config, as_boolean)
set_attribute(self, 'conversion', self.conversion, config, str)
self._period = self.period
return
示例7: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, config):
if config.has_key("node"):
self._Alias__node = config["node"]
elif config.has_key("node_url"):
set_attribute(self, "node_url", REQUIRED, config)
return ConfigurableNode.configure(self, config)
示例8: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure( self, config_dict ):
ConfigurableNode.configure( self, config_dict )
set_attribute( self, 'debug', 0, config_dict, int )
示例9: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self,config):
ConfigurableNode.configure(self, config)
set_attribute(self, self.ION, self.parent, config, as_node)
set_attribute(self, self.MULTIPLIER, REQUIRED, config)
示例10: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, dict):
ConfigurableNode.configure(self, dict)
set_attribute(self, 'debug', 0, dict, as_boolean)
set_attribute(self, 'value', None, dict)
set_attribute(self, '__node_id__', '120075', dict)
示例11: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, cd):
ConfigurableNode.configure(self,cd)
set_attribute(self,'www_file_path','/test_html_node.xyz',cd,str)
html_str = '<a href=%s>Download File</a>' % self.www_file_path
set_attribute(self,'HTML_target_file',html_str,cd,str)
return
示例12: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self,config):
ConfigurableNode.configure(self,config)
set_attribute(self, 'bit', REQUIRED, config, int)
示例13: configure
# 需要导入模块: from mpx.lib.node import ConfigurableNode [as 别名]
# 或者: from mpx.lib.node.ConfigurableNode import configure [as 别名]
def configure(self, config):
ConfigurableNode.configure(self, config)
# set ion attribute to be a reference to parent.
set_attribute(self, 'ion', self.parent, config, as_node)
set_attribute(self, 'divisor', REQUIRED, config, float)