Ejemplo n.º 1
0
    def configure(self):
        self.configure_bundle_upload_auth()

        WalrusRequest.configure(self)

        self.configure_bundle_creds()
        self.configure_bundle_properties()
        self.configure_bundle_output()
        self.generate_encryption_keys()
Ejemplo n.º 2
0
 def configure(self):
     WalrusRequest.configure(self)
     if (self.args.get('literal_dest', False) and
         len(self.args['sources']) != 1):
         # Can't explicitly specify dest file names when we're uploading
         # more than one thing
         raise ArgumentError('argument -T: only allowed with one file')
     if self.args['dest'].startswith('/'):
         raise ArgumentError('destination must begin with a bucket name')
Ejemplo n.º 3
0
 def configure(self):
     WalrusRequest.configure(self)
     if (self.args.get('literal_dest', False)
             and len(self.args['sources']) != 1):
         # Can't explicitly specify dest file names when we're uploading
         # more than one thing
         raise ArgumentError('argument -T: only allowed with one file')
     if self.args['dest'].startswith('/'):
         raise ArgumentError('destination must begin with a bucket name')
Ejemplo n.º 4
0
 def configure(self):
     WalrusRequest.configure(self)
     for path in self.args["paths"]:
         if path.startswith("/"):
             raise ArgumentError(("argument '{0}' must not start with " '"/"; format is BUCKET[/KEY]').format(path))
         bucket = path.split("/", 1)[0]
         try:
             validate_generic_bucket_name(bucket)
         except ValueError as err:
             raise ArgumentError('bucket "{0}": {1}'.format(bucket, err.message))
Ejemplo n.º 5
0
 def configure(self):
     WalrusRequest.configure(self)
     for path in self.args['paths']:
         if path.startswith('/'):
             raise ArgumentError((
                 'argument \'{0}\' must not start with '
                 '"/"; format is BUCKET[/KEY]').format(path))
         bucket = path.split('/', 1)[0]
         try:
             validate_generic_bucket_name(bucket)
         except ValueError as err:
             raise ArgumentError(
                 'bucket "{0}": {1}'.format(bucket, err.message))
Ejemplo n.º 6
0
    def configure(self):
        WalrusRequest.configure(self)

        if self.args['source'] == '-':
            self.files['file'] = sys.stdin
        elif isinstance(self.args['source'], basestring):
            self.files['file'] = open(self.args['source'])
        else:
            self.files['file'] = self.args['source']
        bucket, _, key = self.args['dest'].partition('/')
        if not bucket:
            raise ArgumentError('destination bucket name must be non-empty')
        if not key:
            raise ArgumentError('destination key name must be non-empty')
Ejemplo n.º 7
0
 def configure(self):
     WalrusRequest.configure(self)
     if self.args['source'] == '-':
         if self.args.get('size') is None:
             raise ArgumentError(
                 "argument --size is required when uploading stdin")
         source = _FileObjectExtent(sys.stdin, self.args['size'])
     elif isinstance(self.args['source'], basestring):
         source = _FileObjectExtent.from_filename(self.args['source'])
     else:
         if self.args.get('size') is None:
             raise ArgumentError(
                 "argument --size is required when uploading a file object")
         source = _FileObjectExtent(sys.stdin, self.args['size'])
     self.args['source'] = source
     bucket, _, key = self.args['dest'].partition('/')
     if not bucket:
         raise ArgumentError('destination bucket name must be non-empty')
     if not key:
         raise ArgumentError('destination key name must be non-empty')
Ejemplo n.º 8
0
 def configure(self):
     WalrusRequest.configure(self)
     validate_generic_bucket_name(self.args['bucket'])
Ejemplo n.º 9
0
 def configure(self):
     WalrusRequest.configure(self)
     validate_generic_bucket_name(self.args['bucket'])
Ejemplo n.º 10
0
 def configure(self):
     WalrusRequest.configure(self)
     for path in self.args['paths']:
         if '/' not in path:
             raise ArgumentError("path '{0}' must include a key name")
Ejemplo n.º 11
0
 def configure(self):
     WalrusRequest.configure(self)
     if self.args['numeric_output']:
         self.args['long_output'] = True
Ejemplo n.º 12
0
 def configure(self):
     WalrusRequest.configure(self)
     if self.args['numeric_output']:
         self.args['long_output'] = True
Ejemplo n.º 13
0
 def configure(self):
     self.configure_bundle_upload_auth()
     WalrusRequest.configure(self)
Ejemplo n.º 14
0
 def __init__(self, **kwargs):
     WalrusRequest.__init__(self, **kwargs)
     self.last_upload_error = None
     self._lock = threading.Lock()
Ejemplo n.º 15
0
 def __init__(self, **kwargs):
     WalrusRequest.__init__(self, **kwargs)
     self.last_upload_error = None
     self._lock = threading.Lock()