예제 #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
예제 #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
예제 #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)
예제 #4
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket)
     for k in self.fs._s3bukt.list():
         self.fs._s3bukt.delete_key(k)
예제 #5
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket, "/unittest/files")
     self._clear()
예제 #6
0
 def setUp(self):
     self.fs = s3fs.S3FS(self.bucket)
     self._clear()