예제 #1
0
 def configure(self, config):
     set_attribute(self, 'directory', '/tmp', config)
     set_attribute(self, 'file_prefix', REQUIRED, config)
     set_attribute(self, 'file_suffix', REQUIRED, config)
     set_attribute(self, 'name_scheme', None, config)
     set_attribute(self, 'timestamp_format', '%s', config)
     Transporter.configure(self, config)
     self._last = PersistentDataObject(self)
     self._last.filename = None
     self._last.count = 1
     self._last.load()
예제 #2
0
 def configure(self, config):
     set_attribute(self, 'directory', '/tmp', config)
     set_attribute(self, 'file_prefix', REQUIRED, config)
     set_attribute(self, 'file_suffix', REQUIRED, config)
     set_attribute(self, 'name_scheme', None, config)
     set_attribute(self, 'timestamp_format', '%s', config)
     Transporter.configure(self, config)
     self._last = PersistentDataObject(self)
     self._last.filename = None
     self._last.count = 1
     self._last.load()
예제 #3
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'directory', config)
     get_attribute(self, 'file_prefix', config)
     get_attribute(self, 'file_suffix', config)
     get_attribute(self, 'name_scheme', config)
     get_attribute(self, 'timestamp_format', config)
     return config
예제 #4
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'post_url', config)
     get_attribute(self, 'chunked_data', config, str)
     get_attribute(self, 'debug', config, str)
     get_attribute(self, 'content_type', config)
     get_attribute(self, 'timeout', config, str)
     return config
예제 #5
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'post_url', config)
     get_attribute(self, 'chunked_data', config, str)
     get_attribute(self, 'debug', config, str)
     get_attribute(self, 'content_type', config)
     get_attribute(self, 'timeout', config, str)
     return config
예제 #6
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'directory', config)
     get_attribute(self, 'file_prefix', config)
     get_attribute(self, 'file_suffix', config)
     get_attribute(self, 'name_scheme', config)
     get_attribute(self, 'timestamp_format', config)
     return config
예제 #7
0
파일: standard.py 프로젝트: mcruse/monotone
 def configure(self, config):
     set_attribute(self, 'host', REQUIRED, config)
     set_attribute(self, 'port', 21, config, int)
     set_attribute(self, 'directory', '', config)
     set_attribute(self, 'username', REQUIRED, config)
     set_attribute(self, 'password', REQUIRED, config)
     #CSCtn64870
     if (config.has_key('timeout') and config['timeout'] == ''):
         config['timeout'] = 'None'
     set_attribute(self, 'timeout', None, config, float)
     set_attribute(self, 'file_prefix', 'cisco', config)
     set_attribute(self, 'file_suffix', '.dat', config)
     set_attribute(self, 'name_scheme', 'timestamp', config)
     set_attribute(self, 'timestamp_format', '%s', config)
     set_attribute(self, 'passive_mode', 1, config, as_boolean)
     set_attribute(self, 'file_append', 0, config, as_boolean)
     Transporter.configure(self, config)
     if self._last is None:
         self._last = PersistentDataObject(self)
         self._last.filename = None
         self._last.count = 1
         self._last.load()
예제 #8
0
 def configure(self, config):
     set_attribute(self, 'host', REQUIRED, config)
     set_attribute(self, 'port', 21, config, int)
     set_attribute(self, 'directory', '', config)
     set_attribute(self, 'username', REQUIRED, config)
     set_attribute(self, 'password', REQUIRED, config)
     #CSCtn64870
     if (config.has_key('timeout') and config['timeout'] == ''):
         config['timeout'] = 'None'
     set_attribute(self, 'timeout', None, config, float)
     set_attribute(self, 'file_prefix', 'cisco', config)
     set_attribute(self, 'file_suffix', '.dat', config)
     set_attribute(self, 'name_scheme', 'timestamp', config)
     set_attribute(self, 'timestamp_format', '%s', config)
     set_attribute(self, 'passive_mode', 1, config, as_boolean)
     set_attribute(self, 'file_append', 0, config, as_boolean)
     Transporter.configure(self, config)
     if self._last is None:
         self._last = PersistentDataObject(self)
         self._last.filename = None
         self._last.count = 1
         self._last.load()
예제 #9
0
 def configure(self, config):
     set_attribute(self, 'post_url', REQUIRED, config)
     set_attribute(self, 'chunked_data', 0, config, as_boolean)
     set_attribute(self, 'debug', 0, config, as_boolean)
     set_attribute(self, 'content_type', 'text/html', config)
     set_attribute(self, 'timeout', None, config, float)
     set_attribute(self, 'user', '', config)
     set_attribute(self, 'password', '', config)
     if not self.chunked_data:
         msglog.log('broadway', msglog.types.WARN, 
                    'Exporter will not stream because chunked_data=0')
     url_tuple = urlparse.urlsplit(self.post_url)
     self._server = string.split(url_tuple[1],':')[0]
     if url_tuple[0] == 'http':
         self._port = HTTP_PORT
         self._secure = False
     else:
         self._port = HTTPS_PORT
         self._secure = True
     if ':' in url_tuple[1]:            
         self._port = int(string.split(url_tuple[1],':')[1])
     self._url = urlparse.urlunsplit(('','') + url_tuple[2:])
     Transporter.configure(self, config)
예제 #10
0
 def configure(self, config):
     set_attribute(self, 'post_url', REQUIRED, config)
     set_attribute(self, 'chunked_data', 0, config, as_boolean)
     set_attribute(self, 'debug', 0, config, as_boolean)
     set_attribute(self, 'content_type', 'text/html', config)
     set_attribute(self, 'timeout', None, config, float)
     set_attribute(self, 'user', '', config)
     set_attribute(self, 'password', '', config)
     if not self.chunked_data:
         msglog.log('broadway', msglog.types.WARN,
                    'Exporter will not stream because chunked_data=0')
     url_tuple = urlparse.urlsplit(self.post_url)
     self._server = string.split(url_tuple[1], ':')[0]
     if url_tuple[0] == 'http':
         self._port = HTTP_PORT
         self._secure = False
     else:
         self._port = HTTPS_PORT
         self._secure = True
     if ':' in url_tuple[1]:
         self._port = int(string.split(url_tuple[1], ':')[1])
     self._url = urlparse.urlunsplit(('', '') + url_tuple[2:])
     Transporter.configure(self, config)
예제 #11
0
 def configure(self,config):
     set_attribute(self,'debug',0,config,int)
     set_attribute(self,'host',REQUIRED,config)
     set_attribute(self,'port',25,config,int)
     set_attribute(self,'authenticate',0,config,as_boolean)
     set_attribute(self,'username','',config)
     set_attribute(self,'password','',config)
     set_attribute(self,'sender',REQUIRED,config)
     set_attribute(self,'recipients',REQUIRED,config)
     set_attribute(self,'subject','',config)
     #CSCtg54123
     if (config.has_key('timeout') and config['timeout'] == ''):
         config['timeout'] = 'None'
     set_attribute(self,'timeout',None,config,float)
     set_attribute(self,'custom_domain', "", config, stripped_str)
     set_attribute(self,'as_attachment',0,config,as_boolean)
     set_attribute(self,'subtype','',config)
     if self.subtype not in ('', 'plain', 'html', 'xml'):
         raise ValueError('Subtype must be plain, html, or xml.')
     self._recipients = []
     if hasattr(self, 'recipients'):
         for recipient in string.split(self.recipients,','):
             self._recipients.append(string.strip(recipient))
     Transporter.configure(self, config)
예제 #12
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'host', config)
     get_attribute(self, 'port', config, str)
     get_attribute(self, 'directory', config)
     get_attribute(self, 'username', config)
     get_attribute(self, 'password', config)
     get_attribute(self, 'timeout', config, str)
     get_attribute(self, 'file_prefix', config)
     get_attribute(self, 'file_suffix', config)
     get_attribute(self, 'name_scheme', config)
     get_attribute(self, 'timestamp_format', config)
     get_attribute(self, 'passive_mode', config, as_onoff)
     get_attribute(self, 'file_append', config, str)
     return config
예제 #13
0
파일: standard.py 프로젝트: mcruse/monotone
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'host', config)
     get_attribute(self, 'port', config, str)
     get_attribute(self, 'directory', config)
     get_attribute(self, 'username', config)
     get_attribute(self, 'password', config)
     get_attribute(self, 'timeout', config, str)
     get_attribute(self, 'file_prefix', config)
     get_attribute(self, 'file_suffix', config)
     get_attribute(self, 'name_scheme', config)
     get_attribute(self, 'timestamp_format', config)
     get_attribute(self, 'passive_mode', config, as_onoff)
     get_attribute(self, 'file_append', config, str)
     return config
예제 #14
0
 def configure(self, config):
     set_attribute(self, 'debug', 0, config, int)
     set_attribute(self, 'host', REQUIRED, config)
     set_attribute(self, 'port', 25, config, int)
     set_attribute(self, 'authenticate', 0, config, as_boolean)
     set_attribute(self, 'username', '', config)
     set_attribute(self, 'password', '', config)
     set_attribute(self, 'sender', REQUIRED, config)
     set_attribute(self, 'recipients', REQUIRED, config)
     set_attribute(self, 'subject', '', config)
     #CSCtg54123
     if (config.has_key('timeout') and config['timeout'] == ''):
         config['timeout'] = 'None'
     set_attribute(self, 'timeout', None, config, float)
     set_attribute(self, 'custom_domain', "", config, stripped_str)
     set_attribute(self, 'as_attachment', 0, config, as_boolean)
     set_attribute(self, 'subtype', '', config)
     if self.subtype not in ('', 'plain', 'html', 'xml'):
         raise ValueError('Subtype must be plain, html, or xml.')
     self._recipients = []
     if hasattr(self, 'recipients'):
         for recipient in string.split(self.recipients, ','):
             self._recipients.append(string.strip(recipient))
     Transporter.configure(self, config)
예제 #15
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self,'debug',config)
     get_attribute(self,'host',config)
     get_attribute(self,'port',config,str)
     get_attribute(self,'authenticate',config,str)
     get_attribute(self,'username',config)
     get_attribute(self,'password',config)
     get_attribute(self,'sender',config)
     get_attribute(self,'recipients',config)
     get_attribute(self,'subject',config)
     get_attribute(self,'timeout',config,str)
     get_attribute(self,'custom_domain', config, str)
     get_attribute(self,'as_attachment',config,str)
     get_attribute(self,'subtype', config)
     return config
예제 #16
0
 def configuration(self):
     config = Transporter.configuration(self)
     get_attribute(self, 'debug', config)
     get_attribute(self, 'host', config)
     get_attribute(self, 'port', config, str)
     get_attribute(self, 'authenticate', config, str)
     get_attribute(self, 'username', config)
     get_attribute(self, 'password', config)
     get_attribute(self, 'sender', config)
     get_attribute(self, 'recipients', config)
     get_attribute(self, 'subject', config)
     get_attribute(self, 'timeout', config, str)
     get_attribute(self, 'custom_domain', config, str)
     get_attribute(self, 'as_attachment', config, str)
     get_attribute(self, 'subtype', config)
     return config
예제 #17
0
 def start(self):
     if not self.chunked_data:
         msglog.log('broadway', msglog.types.WARN,
                    'Chunking disabled in exporter, will not stream data')
     return Transporter.start(self)
예제 #18
0
 def start(self):
     if not self.chunked_data:
         msglog.log('broadway',msglog.types.WARN,
                    'Chunking disabled in exporter, will not stream data')
     return Transporter.start(self)