本文整理汇总了Python中mpx.service.ServiceNode.start方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceNode.start方法的具体用法?Python ServiceNode.start怎么用?Python ServiceNode.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpx.service.ServiceNode
的用法示例。
在下文中一共展示了ServiceNode.start方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
if self.has_child('columns'):
_positions = []
columns = []
for child in self.get_child('columns').children_nodes():
if child.position in _positions:
raise EConfiguration(('One or more columns ' +
'have the same position'))
_positions.append(child.position)
column = ColumnConfiguration()
column.configure(child.configuration())
columns.append(column)
_positions.sort()
if _positions != range(0,len(_positions)):
raise EConfiguration((
'Columns do not have consecutive positions this '
'can be caused by having two columns with the same name.'
))
self.log.configure(columns,self.minimum_size,self.maximum_size)
else:
self.log.set_limits(self.minimum_size,self.maximum_size)
self.log.start_trimming() # Turn log trimming on now that sizes are set
self.forwarder.start_forwarding(self.log)
ServiceNode.start(self)
return
示例2: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
ServiceNode.start(self)
# this will correctly add the msglog as a child
# to the logger.
if 'msglog' not in self.children_names():
columns = mpx.lib.msglog.get_columns()
log = Log()
log.configure({'name':'msglog', 'parent':self})
for c in columns:
column = mpx.lib.factory('mpx.service.logger.column')
config = c.configuration()
config['parent'] = log
column.configure(config)
self._logs = PersistentDataObject(self)
self._logs.names = []
self._logs.load()
for name in self._logs.names:
if ((not mpx.lib.log.log_exists(name)) and
(name not in self.children_names())):
log = mpx.lib.log.log(name)
log.destroy()
del(log)
self._logs.names = []
for child in self.children_nodes():
if not isinstance(child, Alias):
# Don't manage other managers' logs...
self._logs.names.append(child.name)
self._logs.save()
示例3: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
if not Server._servers.has_key(self.port):
Server._servers[self.port] = self
self._setup_server()
if Server._thread is None:
Server._thread = _RedusaThread()
Server._thread.start()
ServiceNode.start(self)
示例4: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
if not self.__running:
known_alarms = self.get_child('alarms')
for child in known_alarms.children_nodes():
child.event_subscribe(self, AlarmTriggerEvent)
child.event_subscribe(self, AlarmClearEvent)
self.__running = 1
self.__thread = ImmortalThread(name=self.name,target=self.__run)
self.__thread.start()
ServiceNode.start(self)
return
示例5: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
from mpx.lib.persistent import PersistentDataObject
ServiceNode.start(self)
if self.debug: print 'Garbage Collector Starting!'
self._data = PersistentDataObject(self,dmtype=GC_NEVER)
self._data.registered = []
self._data.load()
if self.debug: print 'GC Data is %s.' % self._data
if self.debug: print 'GC Data._reg is %s.' % self._data.registered
示例6: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
for child in self.children_nodes():
if isinstance(child,Formatter):
if self.formatter is not None:
raise EConfiguration('Can only have one formatter')
self.formatter = child
elif isinstance(child,Transporter):
if self.transporter is not None:
raise EConfiguration('Can only have one transporter')
self.transporter = child
if self.formatter is None or self.transporter is None:
raise EConfiguration('Exporter one formatter '
'and one transporter child')
return ServiceNode.start(self)
示例7: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
self._lock.acquire()
try:
self.log = as_node(self.log)
columns_node = self.log.get_child('columns')
self.ts_position = columns_node.get_child('timestamp').position
# Allow source stamping:
if columns_node.has_child('trigger_node_url'):
self.trigger_node_url_posn = columns_node.get_child('trigger_node_url').position
if columns_node.has_child('trigger_node_msg'):
self.trigger_node_msg_posn = columns_node.get_child('trigger_node_msg').position
self._started = 1
finally:
self._lock.release()
self.export_waiting_alarm()
return ServiceNode.start(self)
示例8: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
if self.enabled:
self.start_count += 1
self._start()
ServiceNode.start(self)
return
示例9: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
ServiceNode.start(self)
示例10: start
# 需要导入模块: from mpx.service import ServiceNode [as 别名]
# 或者: from mpx.service.ServiceNode import start [as 别名]
def start(self):
return ServiceNode.start(self)