コード例 #1
0
 def __init__(self):
     Exporter.__init__(self)
     EventConsumerMixin.__init__(self, self.handle_connected,
                                 self.connection_event_error)
     self.running = 0
     self._scheduled = None
     self._lock = Lock()
コード例 #2
0
 def stop(self):
     self.running = 0
     if self._scheduled is not None:
         try:
             self._scheduled.cancel()
         except:
             pass
     Exporter.stop(self)
コード例 #3
0
 def stop(self):
     self.running = 0
     if self._scheduled is not None:
         try:
             self._scheduled.cancel()
         except:
             pass
     Exporter.stop(self)
コード例 #4
0
ファイル: triggered_exporter.py プロジェクト: mcruse/monotone
 def start(self):
     Exporter.start(self)
     if not self.running:
         self.running = 1
         self.connection = as_node(self.connection_node)
         self._time_keeper = PersistentDataObject(self)
         self._time_keeper.start_time = 0
         self._time_keeper.load()
         self._period = self.parent.parent.period
         self._setup_trigger()
     else: 
         raise EAlreadyRunning
コード例 #5
0
 def start(self):
     Exporter.start(self)
     if not self.running:
         self.running = 1
         self.connection = as_node(self.connection_node)
         self._time_keeper = PersistentDataObject(self)
         self._time_keeper.start_time = 0
         self._time_keeper.load()
         self._period = self.parent.parent.period
         self._setup_trigger()
     else:
         raise EAlreadyRunning
コード例 #6
0
 def start(self):
     Exporter.start(self)
     if not self.running:
         self.running = 1
         self.connection = as_node(self.connection_node)
         self._event_count = self.log_multiple - 1
         self._time_keeper = PersistentDataObject(self)
         self._time_keeper.start_time = 0
         self._time_keeper.load()
         self._period = self.parent.parent.period
         self.parent.parent.event_subscribe(self, LogAddEntryEvent)
     else: 
         raise EAlreadyRunning
コード例 #7
0
 def configure(self, config):
     map_to_attribute(self, "period", 900, config, map_to_seconds)
     if self.period == 0:
         raise EInvalidValue("period", self.period, "Export period cannot be 0")
     set_attribute(self, "debug", 0, config, as_boolean)
     set_attribute(self, "synchronize_on", "00:00", config)
     set_attribute(self, "timeout", 60, config, int)
     set_attribute(self, "connection_node", "/services/network", config)
     set_attribute(self, "connection_attempts", 3, config, int)
     set_attribute(self, "always_export", 0, config, as_boolean)
     set_attribute(self, "breakup_on_period", 0, config, as_boolean)
     Exporter.configure(self, config)
     self._time = _TimeStore(self)
コード例 #8
0
 def start(self):
     Exporter.start(self)
     if not self.running:
         self.running = 1
         self.connection = as_node(self.connection_node)
         self._event_count = self.log_multiple - 1
         self._time_keeper = PersistentDataObject(self)
         self._time_keeper.start_time = 0
         self._time_keeper.load()
         self._period = self.parent.parent.period
         self.parent.parent.event_subscribe(self, LogAddEntryEvent)
     else:
         raise EAlreadyRunning
コード例 #9
0
 def configure(self, config):
     map_to_attribute(self, 'period', 900, config, map_to_seconds)
     if self.period == 0:
         raise EInvalidValue('period', self.period,
                             'Export period cannot be 0')
     set_attribute(self, 'debug', 0, config, as_boolean)
     set_attribute(self, 'synchronize_on', '00:00', config)
     set_attribute(self, 'timeout', 60, config, int)
     set_attribute(self, 'connection_node', '/services/network', config)
     set_attribute(self, 'connection_attempts', 3, config, int)
     set_attribute(self, 'always_export', 0, config, as_boolean)
     set_attribute(self, 'breakup_on_period', 0, config, as_boolean)
     Exporter.configure(self, config)
     self._time = _TimeStore(self)
コード例 #10
0
 def configuration(self):
     config = Exporter.configuration(self)
     get_attribute(self, 'log_multiple', config, str)
     get_attribute(self, 'connection_node', config)
     get_attribute(self, 'connection_attempts', config)
     get_attribute(self, 'timeout', config, int)
     return config
コード例 #11
0
 def configuration(self):
     config = Exporter.configuration(self)
     get_attribute(self,'log_multiple',config,str)
     get_attribute(self,'connection_node',config)
     get_attribute(self,'connection_attempts',config)
     get_attribute(self,'timeout',config,int)
     return config
コード例 #12
0
 def start(self):
     Exporter.start(self)
     if not self.running:
         node = as_node(self.connection_node)
         if hasattr(node, "event_subscribe"):
             node.event_subscribe(self, ConnectionEvent)
         else:
             if self.debug:
                 msg = "Connection node: " + str(self.connection_node) + " is not an event producer."
                 msglog.log("broadway", msglog.types.INFO, msg)
         self.connection = node
         self.running = 1
         self._init_next_time()
         self._schedule()
     else:
         raise EAlreadyRunning
コード例 #13
0
 def start(self):
     Exporter.start(self)
     if not self.running:
         node = as_node(self.connection_node)
         if hasattr(node, 'event_subscribe'):
             node.event_subscribe(self, ConnectionEvent)
         else:
             if self.debug:
                 msg = ('Connection node: ' + str(self.connection_node) +
                        ' is not an event producer.')
                 msglog.log('broadway', msglog.types.INFO, msg)
         self.connection = node
         self.running = 1
         self._init_next_time()
         self._schedule()
     else:
         raise EAlreadyRunning
コード例 #14
0
 def configuration(self):
     config = Exporter.configuration(self)
     map_from_attribute(self, "period", config, map_from_seconds)
     get_attribute(self, "connection_node", config)
     get_attribute(self, "debug", config, str)
     get_attribute(self, "connection_attempts", config)
     get_attribute(self, "timeout", config)
     get_attribute(self, "always_export", config, str)
     get_attribute(self, "synchronize_on", config)
     get_attribute(self, "breakup_on_period", config, str)
     return config
コード例 #15
0
 def configuration(self):
     config = Exporter.configuration(self)
     map_from_attribute(self, 'period', config, map_from_seconds)
     get_attribute(self, 'connection_node', config)
     get_attribute(self, 'debug', config, str)
     get_attribute(self, 'connection_attempts', config)
     get_attribute(self, 'timeout', config)
     get_attribute(self, 'always_export', config, str)
     get_attribute(self, 'synchronize_on', config)
     get_attribute(self, 'breakup_on_period', config, str)
     return config
コード例 #16
0
 def configuration(self):
     config = Exporter.configuration(self)
     get_attribute(self, 'debug', config, str)
     get_attribute(self, 'column', config, str)
     get_attribute(self, 'multi_threaded', config, str)
     return config
コード例 #17
0
 def start(self):
     self.running = 1
     Exporter.start(self)
     return
コード例 #18
0
 def stop(self):
     self.running = 0
     Exporter.stop(self)
コード例 #19
0
 def configure(self, config):
     set_attribute(self, 'log_multiple', 1, config, int)
     set_attribute(self, 'timeout', 60, config, int)
     set_attribute(self, 'connection_node', '/services/network', config)
     set_attribute(self, 'connection_attempts', 3, config, int)
     Exporter.configure(self, config)
コード例 #20
0
 def configure(self, config):
     set_attribute(self,'log_multiple',1,config,int)
     set_attribute(self,'timeout',60,config,int)
     set_attribute(self,'connection_node','/services/network',config)
     set_attribute(self,'connection_attempts',3,config,int)
     Exporter.configure(self, config)
コード例 #21
0
 def __init__(self):
     self.running = 0
     self._lock = Lock()
     Exporter.__init__(self)
     EventConsumerMixin.__init__(self,self.handle_log,self.handle_error)
コード例 #22
0
ファイル: dumc_exporter.py プロジェクト: mcruse/monotone
 def __init__(self):
     Exporter.__init__(self)
     self.running = 0
     self._lock = Lock()
コード例 #23
0
 def __init__(self):
     self.running = 0
     self._lock = Lock()
     Exporter.__init__(self)
     EventConsumerMixin.__init__(self, self.handle_log, self.handle_error)
コード例 #24
0
 def configure(self, config):
     set_attribute(self, 'debug', 0, config, as_boolean)
     set_attribute(self, 'column', 'entry', config)
     set_attribute(self, 'multi_threaded', 1, config, as_boolean)
     Exporter.configure(self, config)
コード例 #25
0
ファイル: dumc_exporter.py プロジェクト: mcruse/monotone
 def configuration(self):
     config = Exporter.configuration(self)
     get_attribute(self,'debug',config,str)
     get_attribute(self,'column',config,str)
     get_attribute(self,'multi_threaded',config,str)
     return config
コード例 #26
0
ファイル: dumc_exporter.py プロジェクト: mcruse/monotone
 def start(self):
     self.running = 1
     Exporter.start(self)
     return
コード例 #27
0
ファイル: dumc_exporter.py プロジェクト: mcruse/monotone
 def configure(self,config):
     set_attribute(self,'debug',0,config,as_boolean)
     set_attribute(self,'column','entry',config)
     set_attribute(self,'multi_threaded',1,config,as_boolean)
     Exporter.configure(self,config)
コード例 #28
0
ファイル: dumc_exporter.py プロジェクト: mcruse/monotone
 def stop(self):
     self.running = 0
     Exporter.stop(self)
コード例 #29
0
 def __init__(self):
     Exporter.__init__(self)
     EventConsumerMixin.__init__(self, self.handle_connected, self.connection_event_error)
     self.running = 0
     self._scheduled = None
     self._lock = Lock()
コード例 #30
0
 def __init__(self):
     Exporter.__init__(self)
     self.running = 0
     self._lock = Lock()