本文整理汇总了Python中mpx.lib.node.ConfigurableNode类的典型用法代码示例。如果您正苦于以下问题:Python ConfigurableNode类的具体用法?Python ConfigurableNode怎么用?Python ConfigurableNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigurableNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: start
def start( self ):
#
# Should I also call ConnectionMixin.start() and
# EventProducerMixin.start()????
ConfigurableNode.start( self )
msg = ''
_msg = ''
# This node is a child of DirectPPP, which in turn is a child of a Port.
self.port = self.parent.parent
try:
if self.enable:
_msg = ( '%s.%s did not start..\nReason\n'
% (str( self.parent.name ), str( self.name )) )
self._enable_direct_ppp()
self._start_ppp_program()
else:
_msg = ( 'Could not disable %s.%s '
% (self.parent.name, self.name) )
self._disable_direct_ppp()
self._start_ppp_program()
except EPermission, e:
msg += _msg
msg += str( e.keywords['reason'] )
开发者ID:mcruse,项目名称:monotone,代码行数:26,代码来源:direct_ppp.py
示例2: __init__
def __init__(self, parent):
self.__parent = parent
self.__cov_count = 0
self._old_value = None
ConfigurableNode.__init__(self)
EventProducerMixin.__init__(self)
return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:points.py
示例3: __init__
def __init__( self ):
ConfigurableNode.__init__( self )
EventProducerMixin.__init__( self )
#
# Set old value to something which will never be valid so that
# we always generate an event on startup.
self.old_value = -99
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:storage.py
示例4: configure
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)
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:InterfaceRouteNode.py
示例5: __init__
def __init__(self, prop_type_id, prop_type_name, prop_inst_num, dev):
ConfigurableNode.__init__(self)
self._prop_type_id = prop_type_id
self._prop_type_name = prop_type_name
self._prop_inst_num = prop_inst_num
self._dev = dev
self.running = 0
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:cpc.py
示例6: __init__
def __init__(self):
ConfigurableNode.__init__(self)
self._url = 'unknown'
self._poll_event = None
self._period = 0.2
# Pre-load attributes.
self.off_text = "Off"
self.on_text = "On"
self.auto_text = "Auto"
self.reverse_output = 0
self.output = REQUIRED
self.input = REQUIRED
self.period = self._period
self.asyncOK = 1
self.state = 2
self.debug = 0
self.__running = False
self._init_debug()
self.OFF = EnumeratedValue(0, self.off_text)
self.ON = EnumeratedValue(1, self.on_text)
self.AUTO = EnumeratedValue(2, self.auto_text)
self._NORMAL = 0
self._SAFETY = 1
self._output_state = self._NORMAL
self._output_lock = Lock()
self._changes_at = 0
self._waiting_value = None
self._value = None
self._lock = Lock()
return
开发者ID:mcruse,项目名称:monotone,代码行数:30,代码来源:__init__.py
示例7: configure
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
开发者ID:mcruse,项目名称:monotone,代码行数:28,代码来源:trigger.py
示例8: configure
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 )
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:direct_ppp.py
示例9: stop
def stop(self):
self.DEBUG3("stop():\n")
ConfigurableNode.stop(self)
self.__running = False
self._begin_critical_section()
try: self._cancel_polling()
finally: self._end_critical_section()
self.DEBUG3("stop: return\n")
return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:__init__.py
示例10: __init__
def __init__(self):
ConfigurableNode.__init__(self)
EventProducerMixin.__init__(self)
EventConsumerMixin.__init__(self)
self._current_id = None
self._event_class = None
self.start_counter = 0
self.pnode_obj = None
self.pnode_subscribed = 0
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:trigger.py
示例11: prune
def prune(self, force=False):
ConfigurableNode.prune(self, force)
new_value = ENoSuchNode(self._pruned_url)
self._value = new_value
cov = ChangeOfValueEvent(self, self._old_value, new_value,
time.time())
self._old_value = new_value
self.event_generate(cov)
return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:points.py
示例12: start
def start(self):
self.DEBUG3("start():\n")
ConfigurableNode.start(self)
self.__running = True
self._begin_critical_section()
try: self._poll_input()
finally: self._end_critical_section()
self.DEBUG3("start: return\n")
return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:__init__.py
示例13: __init__
def __init__( self ):
ConfigurableNode.__init__( self )
self.isRunning = 0
self.ipcheck_pid = 0
self._lock = Lock()
self.thread = None
self.first_time = 0
self.log_name = 'broadway'
self.update_count = 0
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:dyndns.py
示例14: configure
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)
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:test_open.py
示例15: configure
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 )
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:dyndns.py
示例16: start
def start(self):
self.debug_print('Starting...', 0)
ConfigurableNode.start(self)
poll_obj = select.poll()
poll_obj.register(self.parent.file.fileno(), select.POLLIN)
count = 0
while count < 10:
evt_prs = poll_obj.poll()
print 'Got event pair %s.' % evt_prs
self.parent.file.read(1024)
count = count + 1
time.sleep(0.5)
开发者ID:mcruse,项目名称:monotone,代码行数:14,代码来源:test_open.py
示例17: configuration
def configuration(self):
config = ConfigurableNode.configuration(self)
get_attribute(self, 'value',config, str)
get_attribute(self, 'debug',config, str)
get_attribute(self, '__node_id__', config)
return config
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:dynamic_children.py
示例18: configuration
def configuration(self):
config = ConfigurableNode.configuration( self )
get_attribute( self, 'enable', config )
get_attribute( self, 'user_id', config )
get_attribute( self, 'password', config )
get_attribute( self, 'local_ip', config )
get_attribute( self, 'client_ip', config )
get_attribute( self, 'debug', config )
return config
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:direct_ppp.py
示例19: configure
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
开发者ID:mcruse,项目名称:monotone,代码行数:19,代码来源:__init__.py
示例20: configuration
def configuration(self):
config = ConfigurableNode.configuration(self)
get_attribute(self, 'message', config)
get_attribute(self, 'subject', config)
get_attribute(self, 'send_retries', config)
get_attribute(self, 'enabled', config, str)
get_attribute(self, 'prodnode', config, str)
get_attribute(self, 'eventmodule', config, str)
get_attribute(self, 'eventclass', config, str)
get_attribute(self, 'debug', config, int)
return config
开发者ID:mcruse,项目名称:monotone,代码行数:11,代码来源:trigger.py
注:本文中的mpx.lib.node.ConfigurableNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论