本文整理汇总了Python中thumbor.storages.mongo_storage.Storage.get_crypto方法的典型用法代码示例。如果您正苦于以下问题:Python Storage.get_crypto方法的具体用法?Python Storage.get_crypto怎么用?Python Storage.get_crypto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thumbor.storages.mongo_storage.Storage
的用法示例。
在下文中一共展示了Storage.get_crypto方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: topic
# 需要导入模块: from thumbor.storages.mongo_storage import Storage [as 别名]
# 或者: from thumbor.storages.mongo_storage.Storage import get_crypto [as 别名]
def topic(self):
conf = Config(MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
server = get_server('ACME-SEC')
storage = MongoStorage(Context(config=conf, server=server))
storage.put(IMAGE_URL % 6, IMAGE_BYTES)
return storage.get_crypto(IMAGE_URL % 6)
示例2: test_get_crypto_for_url
# 需要导入模块: from thumbor.storages.mongo_storage import Storage [as 别名]
# 或者: from thumbor.storages.mongo_storage.Storage import get_crypto [as 别名]
def test_get_crypto_for_url(self):
rm_storage()
image_url = 'www.globo.com/media/globocom/img/sprite1.png'
http_loaded = http.load(image_url)
storage = Storage()
storage.put(image_url, http_loaded)
assert storage.get_crypto(image_url) == options.SECURITY_KEY
示例3: topic
# 需要导入模块: from thumbor.storages.mongo_storage import Storage [as 别名]
# 或者: from thumbor.storages.mongo_storage.Storage import get_crypto [as 别名]
def topic(self):
conf = Config(MONGO_STORAGE_SERVER_PORT=7777, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=False)
server = get_server('ACME-SEC')
storage = MongoStorage(Context(config=conf, server=server))
storage.put(IMAGE_URL % 11, IMAGE_BYTES)
conf.STORES_CRYPTO_KEY_FOR_EACH_IMAGE = True
storage.put_crypto(IMAGE_URL % 11)
item = storage.get_crypto(IMAGE_URL % 11)
return item.result()
示例4: test_get_crypto_for_url_returns_None_if_urls_was_never_seen
# 需要导入模块: from thumbor.storages.mongo_storage import Storage [as 别名]
# 或者: from thumbor.storages.mongo_storage.Storage import get_crypto [as 别名]
def test_get_crypto_for_url_returns_None_if_urls_was_never_seen(self):
rm_storage()
image_url = 'www.globo.com/media/globocom/img/sprite1.png'
storage = Storage()
assert not storage.get_crypto(image_url)