Beispiel #1
0
    def handle(self, export_id, **options):
        path = options.pop('path')
        if not os.path.isfile(path):
            raise CommandError("File not found: {}".format(path))

        export_instance = get_properly_wrapped_export_instance(export_id)
        with open(path, 'rb') as payload:
            save_export_payload(export_instance, payload)
    def handle(self, export_id, **options):
        path = options.pop('path')
        if not os.path.isfile(path):
            raise CommandError("File not found: {}".format(path))

        export_instance = get_properly_wrapped_export_instance(export_id)
        with open(path, 'rb') as payload:
            save_export_payload(export_instance, payload)
Beispiel #3
0
 def upload(self, final_path):
     logger.info('Uploading final export')
     with open(final_path, 'r') as payload:
         save_export_payload(self.export_instance, payload)
     if not self.keep_file:
         os.remove(final_path)