Beispiel #1
0
 def to_payload(self, source, data, **options):
     #write data to options['archive']
     adaptor = get_adaptor(options['format'])
     encoded_data = adaptor.serialize(data)
     options['archive'].writestr(options['filename'], encoded_data)
     
     return {'source':source, 'filename':options['filename'], 'format':options['format']}
Beispiel #2
0
 def get_data(self):
     response = urlopen(self.url)
     adaptor = get_adaptor(self.options['format'])
     data = adaptor.deserialize(response)
     return data
Beispiel #3
0
 def get_data(self):
     path = self.get_file_path()
     source = self.archive.open(path)
     adaptor = get_adaptor(self.options['format'])
     data = adaptor.deserialize(source)
     return data