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


Python SimpleCookie.itervalues方法代码示例

本文整理汇总了Python中Cookie.SimpleCookie.itervalues方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleCookie.itervalues方法的具体用法?Python SimpleCookie.itervalues怎么用?Python SimpleCookie.itervalues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cookie.SimpleCookie的用法示例。


在下文中一共展示了SimpleCookie.itervalues方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: COOKIES

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
 def COOKIES(self):
     if 'brick.cookies' not in self.environ:
         raw_dict = SimpleCookie(self.environ.get('HTTP_COOKIE',''))
         self.environ['brick.cookies'] = {}
         for cookie in raw_dict.itervalues():
             self.environ['brick.cookies'][cookie.key] = cookie.value
     return self.environ['brick.cookies']
开发者ID:zruibin,项目名称:bottle,代码行数:9,代码来源:http.py

示例2: COOKIES

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
 def COOKIES(self):
     """ Returns a dict with COOKIES. """
     if self._COOKIES is None:
         raw_dict = SimpleCookie(self._environ.get('HTTP_COOKIE',''))
         self._COOKIES = {}
         for cookie in raw_dict.itervalues():
             self._COOKIES[cookie.key] = cookie.value
     return self._COOKIES
开发者ID:codycollier,项目名称:ocelog,代码行数:10,代码来源:bottle.py

示例3: __process_cookies

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
 def __process_cookies(self):
     simple_cookie = SimpleCookie(self.headers.get("Cookie",{}))
     cookies = dict()
     
     for cookie in simple_cookie.itervalues():            
         cookies[cookie.key] = cookie.value
     
     return cookies
开发者ID:john-charles,项目名称:plywood,代码行数:10,代码来源:http.py

示例4: COOKIES

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
 def COOKIES(self):
     """ Dictionary with parsed cookie data. """
     if self._COOKIES is None:
         raw_dict = SimpleCookie(self.environ.get('HTTP_COOKIE',''))
         self._COOKIES = {}
         for cookie in raw_dict.itervalues():
             self._COOKIES[cookie.key] = cookie.value
     return self._COOKIES
开发者ID:digvan,项目名称:redeet,代码行数:10,代码来源:bottle.py

示例5: COOKIES

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
 def COOKIES(self):
     """ Cookies parsed into a dictionary. Secure cookies are NOT decoded
         automatically. See :meth:`get_cookie` for details.
     """
     raw_dict = SimpleCookie(self.headers.get('Cookie',''))
     cookies = {}
     for cookie in raw_dict.itervalues():
         cookies[cookie.key] = cookie.value
     return cookies
开发者ID:CodeSummer,项目名称:YouMd,代码行数:11,代码来源:request.py

示例6: _get_cookies

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
    def _get_cookies(self, response):
        c = SimpleCookie()
        for h, v in response.getheaders():
            if h == 'set-cookie':
                c.load(v)

        for cookie in c.itervalues():
            domain = cookie['domain'].rstrip(',').lstrip('.') or response.host
            self.cookies[domain][cookie.key] = cookie
开发者ID:baverman,项目名称:swoop,代码行数:11,代码来源:session.py

示例7: set_cookie

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
    def set_cookie(self, name, value=None, domain='_all'):
        if isinstance(name, Cookie):
            name, value = name.name, name.value
            domain = name.domain or domain

        c = SimpleCookie()
        c[name] = value

        for cookie in c.itervalues():
            self.cookies[domain.rstrip(',').lstrip('.')][cookie.key] = cookie
开发者ID:baverman,项目名称:swoop,代码行数:12,代码来源:session.py

示例8: set_state

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
    def set_state(self, state):
        self.cookies.clear()

        for domain, values in state.iteritems():
            c = SimpleCookie()
            for v in values:
                c.load(v)

            for cookie in c.itervalues():
                self.cookies[domain][cookie.key] = cookie
开发者ID:baverman,项目名称:swoop,代码行数:12,代码来源:session.py

示例9: HTTPPreamble

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
class HTTPPreamble(object):
    def __init__(self, status_code=httplib.OK, reason=None, version='HTTP/1.1', headers=None, cookies=None):
        self.status_code = status_code
        self.reason = reason
        self.version = version
        self.headers = headers or {}
        self.cookies = SimpleCookie()
        for key, value in (cookies or {}).iteritems():
            if isinstance(value, dict):
                self.cookies[key] = value['value']
                for name, morsel_attr in value:
                    self.cookies[key][name] = morsel_attr
            else:
                self.cookies[key] = value

    def __str__(self):
        lines = [utf8(self.version + b' ' + str(self.status_code) + b' ' + (self.reason or httplib.responses[self.status_code]))]
        for name, values in self.headers.iteritems():
            lines.extend([utf8(name) + b': ' + utf8(value) for value in (values if isinstance(values, list) else [values])])
        lines.extend([str(cookie) for cookie in self.cookies.itervalues()])
        return b'\r\n'.join(lines) + b'\r\n\r\n'
开发者ID:alekstorm,项目名称:vortex,代码行数:23,代码来源:__init__.py

示例10: kcookies

# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import itervalues [as 别名]
 def kcookies(self):
     d=SimpleCookie(self.e.get('HTTP_COOKIE',''));c={}
     for i in d.itervalues():c[i.key]=i.value
     return c
开发者ID:hashmalech,项目名称:orvet,代码行数:6,代码来源:orvet.py


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