• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python service.ServiceNode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mpx.service.ServiceNode的典型用法代码示例。如果您正苦于以下问题:Python ServiceNode类的具体用法?Python ServiceNode怎么用?Python ServiceNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: start

 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
开发者ID:mcruse,项目名称:monotone,代码行数:25,代码来源:log.py


示例2: configure

 def configure(self, config):
     ServiceNode.configure(self, config)
     set_attribute(self, 'server_url', REQUIRED, config)
     set_attribute(self, 'node', REQUIRED, config)
     set_attribute(self, 'period', 30, config, int)
     set_attribute(self,'connection','/services/network',config,as_node)
     set_attribute(self,'timeout',60,config,int)
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:sie_command.py


示例3: configure

 def configure(self, config):
     ServiceNode.configure(self, config)
     set_attribute(self, 'log', self.parent.parent, config, as_node)
     set_attribute(self, 'gm_time', 1, config, as_boolean)
     self.time_function = time.localtime
     if self.gm_time:
         self.time_function = time.gmtime
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_exporter.py


示例4: configure

 def configure(self, config):
     ServiceNode.configure(self, config)
     set_attribute(self, 'heating', REQUIRED, config, as_node)
     set_attribute(self, 'cooling', REQUIRED, config, as_node)
     set_attribute(self, 'temperature', REQUIRED, config, as_node)
     set_attribute(self, 'minimum', REQUIRED, config, float)
     set_attribute(self, 'maximum', REQUIRED, config, float)
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:service.py


示例5: __init__

 def __init__(self):
     ServiceNode.__init__(self)
     UTC().configure({'name':'UTC','parent':self})
     Local().configure({'name':'local','parent':self})
     self._tz_mtime = None
     self._in_err = False
     self._scheduled = None
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:__init__.py


示例6: start

 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()
开发者ID:mcruse,项目名称:monotone,代码行数:28,代码来源:logger.py


示例7: configure

 def configure(self, config):
     set_attribute(self, 'debug', 0, config, int)
     set_attribute(self, 'ip', '', config)
     default = '${mpx.properties.%s_PORT}' % self.server_type
     set_attribute(self,'port',default,config,int)
     set_attribute(self,'user_manager',
                   as_node('/services/User Manager'),config,as_node)
     set_attribute(self,'authentication','form',config)
     if (self.authentication is not None and
         self.authentication not in ('digest','basic','form')):
         raise EInvalidValue('authentication',self.authentication,
                             'Authentication scheme not recognized.')
     set_attribute(self,'port',default,config,int)
     set_attribute(self, 'maintenance_interval', 25, config, int)
     set_attribute(self, 'zombie_timeout', 600, config, int)
     set_attribute(self, 'thread_count', 3, config, int)        
     if not self.has_child("Request Responder"):
         self._setup_request_responder()
     if not self.has_child("Authenticator"):
         self._setup_authentication_handler()
     if not self.has_child("PSP Handler"):
         self._setup_psp_handler()
     if not self.has_child("JSON-RPC Handler"):
         self._setup_json_handler()
     ServiceNode.configure(self, config)
开发者ID:mcruse,项目名称:monotone,代码行数:25,代码来源:__init__.py


示例8: start

 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)
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:__init__.py


示例9: configure

 def configure(self,config):
     ServiceNode.configure(self,config)
     set_attribute(self,'connection','/services/network',config,as_node)
     set_attribute(self,'timeout',60,config,int)
     set_attribute(self, 'gm_time', 1, config, as_boolean)
     self.time_function = time.localtime
     if self.gm_time:
         self.time_function = time.gmtime
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:exporter.py


示例10: __init__

    def __init__(self):
        ServiceNode.__init__(self)
        self.debug = 0
        self._registered = ()
        self._did_save = 0
        self._post_configuration=0

        if self.debug: print 'Initialized _registered to [] for %s.' % self
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:garbage_collector.py


示例11: __init__

 def __init__(self):
     ServiceNode.__init__(self)
     self._added_thread_count = 0
     self._file_request_handler = None
     self.psp_handler = None
     self.authenticator = None
     self.request_responder = None
     self.request_manager = _request.RequestSingleton().request_manager
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:__init__.py


示例12: __init__

 def __init__(self):
     self._lock = Lock()
     self._started = 0
     self._alarm = [] # can have a whole MESS o' alarms at startup...
     self._scheduled = None
     self.trigger_node_url_posn = None # allow source stamping
     self.trigger_node_msg_posn = None # allow source stamping
     self._waiting_alarm_sid = None
     ServiceNode.__init__(self)
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:exporter.py


示例13: stop

 def stop(self):
     if not self._waiting_alarm_sid is None:
         try:
             scheduler.remove(self._waiting_alarm_sid)
         except: # SID may already have expired and been removed...
             msglog.exception()
         self._waiting_alarm_sid = None
     self._started = 0
     ServiceNode.stop(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:exporter.py


示例14: start

 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
开发者ID:mcruse,项目名称:monotone,代码行数:11,代码来源:__init__.py


示例15: __init__

 def __init__(self):
     ServiceNode.__init__(self)
     self.transportClass = None # can't be set until we configure security
     self.was_enabled = 0
     self.enabled = 0
     self.start_count = 0
     self.stop_count = 0
     self.state = self.STOPPED
     self.debug = 0
     self.__rna_thread = None
     return
开发者ID:mcruse,项目名称:monotone,代码行数:11,代码来源:rna.py


示例16: start

    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
开发者ID:mcruse,项目名称:monotone,代码行数:13,代码来源:garbage_collector.py


示例17: configuration

 def configuration(self):
     config = ServiceNode.configuration(self)
     get_attribute(self, 'heating', config, as_node_url)
     get_attribute(self, 'cooling', config, as_node_url)
     get_attribute(self, 'temperature', config, as_node_url)
     get_attribute(self, 'minimum', config, str)
     get_attribute(self, 'maximum', config, str)
     return config
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:service.py


示例18: configuration

 def configuration(self):
     config = ServiceNode.configuration(self)
     get_attribute(self, 'server_url', config)
     get_attribute(self, 'node', config)
     get_attribute(self, 'period', config, str)
     get_attribute(self,'connection',config,as_node_url)
     get_attribute(self,'timeout',config,str)
     return config
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:sie_command.py


示例19: __init__

 def __init__(self):
     ServiceNode.__init__(self)
     self._tzklass = tzinfo.TZInfo
     year = {'name':'year','index':0}
     month = {'name':'month','index':1}
     day = {'name':'day','index':2}
     hour = {'name':'hour','index':3}
     minute  = {'name':'minute','index':4}
     second  = {'name':'second','index':5}
     weekday = {'name':'weekday','index':6}
     ta = [year,month,day,hour,minute,weekday,second]
     for x in ta:
         y = TimeAttribute(x['index'])
         y.configure({'name':x['name'],'parent':self})
     milliseconds = MilliSeconds()
     milliseconds.configure({'name':'milliseconds','parent':self})   
     return
开发者ID:mcruse,项目名称:monotone,代码行数:17,代码来源:time_zone.py


示例20: configure

 def configure(self, config):
     ServiceNode.configure(self, config)
     set_attribute(self, 'security_level', 'NoSec', config)
     msglog.log('broadway', msglog.types.INFO,
                'RNA_Socket.configure: security_level = %s.' % self.security_level)
     self.transportClass = SimpleTcpService
     if (self.security_level == 'Auth-Only') \
         or (self.security_level == 'Full-Enc'):
         self.transportClass = SrnaService
     # Handle changes to the enabled attribute, once we've started.
     if self.enabled != self.was_enabled:
         if self.enabled:
             if self.start_count and self._start():
                 self.start_count += 1
                 self.was_enabled = self.enabled
         elif self.start_count > self.stop_count:
             self.stop_count += 1
             self._stop()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:19,代码来源:rna.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python subscription_manager.SUBSCRIPTION_MANAGER类代码示例发布时间:2022-05-27
下一篇:
Python threading.Lock类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap