本文整理汇总了Python中swift.common.wsgi.WSGIContext.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python WSGIContext.__init__方法的具体用法?Python WSGIContext.__init__怎么用?Python WSGIContext.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类swift.common.wsgi.WSGIContext
的用法示例。
在下文中一共展示了WSGIContext.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, env, app, account_name, token, container_name,
**kwargs):
WSGIContext.__init__(self, app)
self.container_name = unquote(container_name)
self.account_name = unquote(account_name)
env['HTTP_X_AUTH_TOKEN'] = token
env['PATH_INFO'] = '/v1/%s/%s' % (account_name, container_name)
示例2: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, env, app, account_name, token, **kwargs):
WSGIContext.__init__(self, app)
conf = kwargs.get('conf', {})
self.logger = kwargs.get('logger', {})
env['HTTP_X_AUTH_TOKEN'] = token[0]
env['HTTP_X_AUTH_TOKEN_ALT'] = token[1]
env['PATH_INFO'] = '/v1/%s' % account_name
示例3: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, env, app, account_name, token, container_name,
**kwargs):
WSGIContext.__init__(self, app)
self.container_name = unquote(container_name)
self.account_name = unquote(account_name)
env['HTTP_X_AUTH_TOKEN'] = token
env['PATH_INFO'] = '/v1/%s/%s' % (account_name, container_name)
conf = kwargs.get('conf', {})
self.location = conf.get('location', 'US')
示例4: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, env, app, account_name, token, container_name, **kwargs):
self.MAX_BUCKET_LISTING = 1000
WSGIContext.__init__(self, app)
self.container_name = unquote(container_name)
self.account_name = unquote(account_name)
env["HTTP_X_AUTH_TOKEN"] = token
env["PATH_INFO"] = "/v1/AUTH_%s/%s" % (account_name, container_name)
conf = kwargs.get("conf", {})
self.location = conf.get("location", "US")
示例5: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, staticweb, version, account, container, obj):
WSGIContext.__init__(self, staticweb.app)
self.version = version
self.account = account
self.container = container
self.obj = obj
self.app = staticweb.app
self.agent = "%(orig)s StaticWeb"
# Results from the last call to self._get_container_info.
self._index = self._error = self._listings = self._listings_css = self._dir_type = None
示例6: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, staticweb, version, account, container, obj):
WSGIContext.__init__(self, staticweb.app)
self.version = version
self.account = account
self.container = container
self.obj = obj
self.app = staticweb.app
self.cache_timeout = staticweb.cache_timeout
self.logger = staticweb.logger
self.access_logger = staticweb.access_logger
self.log_headers = staticweb.log_headers
self.agent = '%(orig)s StaticWeb'
# Results from the last call to self._get_container_info.
self._index = self._error = self._listings = self._listings_css = None
示例7: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, rewrite, conf):
WSGIContext.__init__(self, rewrite.app)
self.app = rewrite.app
self.logger = rewrite.logger
self.account = conf['account'].strip()
self.thumbhost = conf['thumbhost'].strip()
self.thumborhost = conf['thumborhost'].strip() if 'thumborhost' in conf else None
self.thumbor_wiki_list = [item.strip() for item in conf['thumbor_wiki_list'].split(',')] if 'thumbor_wiki_list' in conf else None
self.user_agent = conf['user_agent'].strip()
self.bind_port = conf['bind_port'].strip()
self.shard_container_list = [item.strip() for item in conf['shard_container_list'].split(',')]
# this parameter controls whether URLs sent to the thumbhost are sent as is (eg. upload/proj/lang/) or with the site/lang
# converted and only the path sent back (eg en.wikipedia/thumb).
self.backend_url_format = conf['backend_url_format'].strip() # asis, sitelang
示例8: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, swascii, version, account, container, obj, conf):
WSGIContext.__init__(self, swascii.app)
self.app = swascii.app
self.version = version
self.account = account
self.container = container
self.obj = obj
self.greyscale = [" ",
" ",
".,-",
"_ivc=!/|\~=",
"gjez2](YL)t[+T7Vf",
"mdK4~GbNDXY5P*Q",
"W8KMA",
"#%$"
]
self.zonebounds = [36, 72, 108, 144, 180, 216, 252]
示例9: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, rewrite, conf):
def striplist(l):
return([x.strip() for x in l])
WSGIContext.__init__(self, rewrite.app)
self.app = rewrite.app
self.logger = rewrite.logger
self.account = conf['account'].strip()
self.thumbhost = conf['thumbhost'].strip()
self.user_agent = conf['user_agent'].strip()
self.bind_port = conf['bind_port'].strip()
self.shard_containers = conf['shard_containers'].strip() #all, some, none
if (self.shard_containers == 'some'):
# if we're supposed to shard some containers, get a cleaned list of the containers to shard
self.shard_container_list = striplist(conf['shard_container_list'].split(','))
# this parameter controls whether URLs sent to the thumbhost are sent as is (eg. upload/proj/lang/) or with the site/lang
# converted and only the path sent back (eg en.wikipedia/thumb).
self.backend_url_format = conf['backend_url_format'].strip() #'asis', 'sitelang'
示例10: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, slo, slo_etag):
WSGIContext.__init__(self, slo.app)
self.slo_etag = '"' + slo_etag.hexdigest() + '"'
示例11: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, wsgi_app, logger):
WSGIContext.__init__(self, wsgi_app)
self.logger = logger
示例12: __init__
# 需要导入模块: from swift.common.wsgi import WSGIContext [as 别名]
# 或者: from swift.common.wsgi.WSGIContext import __init__ [as 别名]
def __init__(self, slowdown, data_to_read, sleep_time, req):
WSGIContext.__init__(self, slowdown.app)
self.data_to_read = data_to_read
self.sleep_time = sleep_time
self.req = req