本文整理汇总了Python中tc_aws.storages.s3_storage.Storage类的典型用法代码示例。如果您正苦于以下问题:Python Storage类的具体用法?Python Storage怎么用?Python Storage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Storage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: topic
def topic(self):
self.conn = S3Connection()
self.conn.create_bucket(s3_bucket)
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
return storage.resolve_original_photo_path("toto")
示例2: topic
def topic(self):
self.conn = S3Connection()
self.conn.create_bucket(s3_bucket)
config = Config(STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
return storage.get_detector_data(IMAGE_URL % '9999')
示例3: topic
def topic(self):
self.conn = S3Connection()
self.conn.create_bucket(s3_bucket)
config = Config(STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
return storage.exists(IMAGE_URL % "9999")
示例4: topic
def topic(self, callback):
self.conn = S3Connection()
self.conn.create_bucket(s3_bucket)
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
storage.put(IMAGE_URL % '4', IMAGE_BYTES) # 1: we put the image
storage.remove(IMAGE_URL % '4') # 2: we delete it
storage.exists(IMAGE_URL % '4', callback=callback) # 3: we check it exists