当前位置: 首页>>代码示例>>Python>>正文


Python WSGIContext.__init__方法代码示例

本文整理汇总了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)
开发者ID:TMG-nl,项目名称:swift3,代码行数:9,代码来源:middleware.py

示例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
开发者ID:kostecky,项目名称:swift3,代码行数:9,代码来源:middleware.py

示例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')
开发者ID:CiscoSystems,项目名称:swift-plugin-s3,代码行数:11,代码来源:middleware.py

示例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")
开发者ID:pyKun,项目名称:swift3,代码行数:11,代码来源:bucket.py

示例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
开发者ID:zhouyuan,项目名称:swift,代码行数:12,代码来源:staticweb.py

示例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
开发者ID:CiscoSystems,项目名称:swift,代码行数:16,代码来源:staticweb.py

示例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
开发者ID:hpdang,项目名称:mediawiki-vagrant,代码行数:17,代码来源:rewrite.py

示例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]
开发者ID:ahale,项目名称:swascii,代码行数:19,代码来源:middleware.py

示例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'
开发者ID:huadaonan,项目名称:dev-puppet,代码行数:21,代码来源:rewrite.py

示例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() + '"'
开发者ID:674009287,项目名称:swift,代码行数:5,代码来源:slo.py

示例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
开发者ID:ISCAS-VDI,项目名称:swift-base,代码行数:5,代码来源:versioned_writes.py

示例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
开发者ID:dpgoetz,项目名称:slowdown,代码行数:7,代码来源:slowdown.py


注:本文中的swift.common.wsgi.WSGIContext.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。