Beispiel #1
0
 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
Beispiel #2
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
    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
        if 'thumbor_wiki_list' in conf:
            self.thumbor_wiki_list = [
                item.strip() for item in conf['thumbor_wiki_list'].split(',')
            ]
        else:
            self.thumbor_wiki_list = 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
        self.tld = conf['tld'].strip()
Beispiel #5
0
 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")
 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')
Beispiel #7
0
 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')
Beispiel #8
0
 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
Beispiel #9
0
 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
Beispiel #10
0
 def __init__(self, env, app, account_name, token, container_name,
              object_name, **kwargs):
     WSGIContext.__init__(self, app)
     self.account_name = unquote(account_name)
     self.container_name = unquote(container_name)
     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/%s/%s' % (account_name, container_name,
                                          object_name)
     self.logger.debug("ObjectController env: %s" % env)
Beispiel #11
0
    def __init__(self, rewrite, conf):
        WSGIContext.__init__(self, rewrite.app)
        self.app = rewrite.app
        self.logger = rewrite.logger

        self.account = conf['account'].strip()
        self.thumborhost = conf['thumborhost'].strip()
        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(',')
        ]
Beispiel #12
0
 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
Beispiel #13
0
 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
Beispiel #14
0
    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
Beispiel #15
0
 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]
Beispiel #16
0
    def __init__(self, rewrite, conf):
        WSGIContext.__init__(self, rewrite.app)
        self.app = rewrite.app
        self.logger = rewrite.logger

        self.account = conf['account'].strip()
        self.thumborhost = conf['thumborhost'].strip()
        self.inactivedc_thumborhost = conf['inactivedc_thumborhost'].strip()
        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(',')
        ]
        self.thumbnail_update_expiry_headers = \
            conf['thumbnail_update_expiry_headers'].strip().lower() == 'true'
        self.thumbnail_expiry = conf['thumbnail_expiry'].strip()
        self.thumbnail_user = conf['thumbnail_user'].strip()
        self.thumbnail_key = conf['thumbnail_key'].strip()
Beispiel #17
0
    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'
Beispiel #18
0
    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'
Beispiel #19
0
 def __init__(self, slo, slo_etag):
     WSGIContext.__init__(self, slo.app)
     self.slo_etag = '"' + slo_etag.hexdigest() + '"'
 def __init__(self, env, app, account_name, token, **kwargs):
     WSGIContext.__init__(self, app)
     env['HTTP_X_AUTH_TOKEN'] = token
     env['PATH_INFO'] = '/v1/%s' % account_name
Beispiel #21
0
 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
 def __init__(self, wsgi_app, logger):
     WSGIContext.__init__(self, wsgi_app)
     self.logger = logger
Beispiel #23
0
 def __init__(self, env, app, account_name, token, **kwargs):
     WSGIContext.__init__(self, app)
     env['HTTP_X_AUTH_TOKEN'] = token
     env['PATH_INFO'] = '/v1/%s' % account_name
 def __init__(self, wsgi_app, logger):
     WSGIContext.__init__(self, wsgi_app)
     self.logger = logger