예제 #1
0
파일: trigger.py 프로젝트: mcruse/monotone
 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
예제 #2
0
    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)
예제 #3
0
 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
예제 #4
0
    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)
예제 #5
0
 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)
예제 #6
0
 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 )
예제 #7
0
    def configure(self, config):
        """method configure(): Called by MFW."""
        self.debug_print('Starting configuration...', 0)

        ConfigurableNode.configure(self, config) # includes addition of "parent" attr

        self._port = self.parent

        self.debug_print('Configuration complete.', 0)
예제 #8
0
	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)
예제 #9
0
    def configure(self, config):
        """method configure(): Called by MFW."""
        self.debug_print('Starting configuration...', 0)

        ConfigurableNode.configure(
            self, config)  # includes addition of "parent" attr

        self._port = self.parent

        self.debug_print('Configuration complete.', 0)
예제 #10
0
 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 )
예제 #11
0
    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)
예제 #12
0
파일: __init__.py 프로젝트: mcruse/monotone
 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
예제 #13
0
 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
예제 #14
0
파일: __init__.py 프로젝트: mcruse/monotone
 def configure(self, config):
     set_attribute(self, 'debug', self.debug, config, int)
     self._init_debug()
     self.DEBUG3("configure(%r):\n", config)
     # @fixme Add the option to output on change (default), output every
     #        time, or the check the outputs state.
     ConfigurableNode.configure(self, config)
     self._url = as_node_url(self)
     if self.output is REQUIRED:
         self.output = self.parent
     set_attribute(self, 'off_text', self.off_text, config, str)
     set_attribute(self, 'on_text', self.on_text, config, str)
     set_attribute(self, 'auto_text', self.auto_text, config, str)
     set_attribute(self, 'reverse_output', self.reverse_output, config, int)
     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)
     set_attribute(self, 'state', self.state, config, self._set_state)
     set_attribute(self, 'enabled', 1, config, as_boolean)
     set_attribute(self, 'min_on_time', 0, config, float)
     set_attribute(self, 'min_off_time', 0, config, float)
     return
예제 #15
0
 def configure(self, config):
     set_attribute(self, 'debug', self.debug, config, int)
     self._init_debug()
     self.DEBUG3("configure(%r):\n", config)
     # @fixme Add the option to output on change (default), output every
     #        time, or the check the outputs state.
     ConfigurableNode.configure(self, config)
     self._url = as_node_url(self)
     if self.output is REQUIRED:
         self.output = self.parent
     set_attribute(self, 'off_text', self.off_text, config, str)
     set_attribute(self, 'on_text', self.on_text, config, str)
     set_attribute(self, 'auto_text', self.auto_text, config, str)
     set_attribute(self, 'reverse_output', self.reverse_output, config, int)
     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)
     set_attribute(self, 'state', self.state, config, self._set_state)
     set_attribute(self, 'enabled', 1, config, as_boolean)
     set_attribute(self, 'min_on_time', 0, config, float)
     set_attribute(self, 'min_off_time', 0, config, float)
     return
예제 #16
0
 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)
예제 #17
0
 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)
예제 #18
0
파일: __init__.py 프로젝트: mcruse/monotone
 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)
예제 #19
0
파일: enx.py 프로젝트: ed-aicradle/monotone
 def configure(self, config):
     ConfigurableNode.configure(self, config)
     set_attribute(self, 'bit', REQUIRED, config, int)
예제 #20
0
 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)
예제 #21
0
파일: enx.py 프로젝트: mcruse/monotone
 def configure(self,config):
     ConfigurableNode.configure(self,config)
     set_attribute(self, 'bit', REQUIRED, config, int)
예제 #22
0
 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
예제 #23
0
 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)
예제 #24
0
파일: dg50.py 프로젝트: mcruse/monotone
 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)
예제 #25
0
 def configure( self, config_dict ):     
     ConfigurableNode.configure( self, config_dict )
     set_attribute( self, 'debug', 0, config_dict, int )
예제 #26
0
    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)
예제 #27
0
 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)
예제 #28
0
 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