Esempio n. 1
0
 def CreateReader(cls, location):
     parse = urlparse(location)
     if parse.scheme == 's3':
         path = parse.path.split('/', 2)
         result = S3Reader(location=s3fs.S3FS(
             bucket=path[1], prefix=path[2] if len(path) == 3 else ''))
         return result
     return None
Esempio n. 2
0
    def CreateWriter(cls, location):
        """Return an instance of this class if it handles the location

        location must be a string with the format: s3://domain/bucket/
        (an optional folder inside the bucket can be used)

        """
        parse = urlparse(location)
        if parse.scheme == 's3':
            path = parse.path.split('/', 2)
            result = S3Writer(location=s3fs.S3FS(
                bucket=path[1], prefix=path[2] if len(path) == 3 else ''))
            return result
        return None
Esempio n. 3
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket, "/unittest/files")
     for k in self.fs._s3bukt.list():
         self.fs._s3bukt.delete_key(k)
Esempio n. 4
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket)
     for k in self.fs._s3bukt.list():
         self.fs._s3bukt.delete_key(k)
Esempio n. 5
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket, "/unittest/files")
     self._clear()
Esempio n. 6
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket)
     self._clear()