Lines Matching defs:for
1 r"""HTTP cookie handling for web clients.
38 import http.client # only for the default HTTP port
67 # There are a few catch-all except: statements in this module, for
92 MONTHS_LOWER = [month.lower() for month in MONTHS]
261 # fast exit for strictly conforming string
308 As for http2time, but parses the ISO 8601 formats:
358 This means that this function is useful for parsing header fields that
360 the requirement for tokens).
379 Each header is represented by a list of key/value pairs. The value for a
395 for text in header_values:
447 for pairs in lists:
449 for k, v in pairs:
467 """Ad-hoc parser for Netscape protocol cookie-attributes.
469 The old Netscape cookie format for Set-Cookie can for instance contain
478 Currently, this is also used for parsing RFC 2109 cookies.
486 for ns_header in ns_headers:
494 for ii, param in enumerate(ns_header.split(';')):
506 # allow for a distinction between present and empty and missing
538 # This may well be wrong. Which RFC is HDN defined in, if any (for
623 Variation from RFC: returned value is lowercased, for convenient
686 # (And here, for new URI schemes: RFC 2718)
750 standards. CookieJar.make_cookies is the factory function for Cookie
753 responsible for checking them to see whether they should be accepted from
757 rather than"Port=80", for example); if this is the case, port is None.
789 # (as clarified in draft errata). Needed for the returned $Domain
824 return "<Cookie %s for %s>" % (namevalue, limit)
828 for name in ("version", "name", "value",
846 The subclass DefaultCookiePolicy defines the standard rules for Netscape
875 """Implements the standard rules for accepting and returning cookies."""
927 for blocked_domain in self._blocked_domains:
944 for allowed_domain in self._allowed_domains:
960 for n in "version", "verifiability", "name", "path", "domain", "port":
1070 _debug(" host prefix %s for domain %s contains a dot",
1082 for p in cookie.port.split(","):
1107 for n in "version", "verifiability", "secure", "expires", "port", "domain":
1152 for p in cookie.port.split(","):
1229 for obj in list(mapping.values()):
1276 _debug("Checking %s for cookies to return", domain)
1278 for path in cookies_by_path.keys():
1282 for cookie in cookies_by_name.values():
1293 for domain in self._cookies.keys():
1312 for cookie in cookies:
1326 # (not for Netscape protocol, which already has any quotes
1379 for cookie in cookies:
1410 for cookie_attrs in attrs_set:
1427 for k, v in cookie_attrs[1:]:
1429 # don't lose case distinction for unknown fields
1441 _debug(" missing value for domain attribute")
1451 _debug(" missing or invalid value for expires "
1459 _debug(" missing or invalid (non-numeric) value for "
1472 _debug(" missing value for %s attribute" % k)
1582 for tup in cookie_tuples:
1591 for cookie in cookies:
1601 # get cookie-attributes for RFC 2965 and Netscape protocols
1633 # Look for Netscape cookies (from Set-Cookie headers) that match
1637 # bundled in with the Netscape cookies for this purpose, which is
1641 for cookie in cookies:
1685 for cookie in self.make_cookies(response, request):
1728 for cookie in self:
1747 for cookie in self:
1759 for cookie in self: i = i + 1
1764 for cookie in self: r.append(repr(cookie))
1769 for cookie in self: r.append(str(cookie))
1773 # derives from OSError for backwards-compatibility with Python 2.4.0
1852 for k in keys:
1875 ignore_discard and ignore_expires: see docstring for FileCookieJar.save
1880 for cookie in self:
1928 for data in split_header_words([line]):
1932 for k in boolean_attrs:
1934 for k, v in data[1:]:
1939 # don't lose case distinction for unknown fields
2039 # skip comments and blank lines XXX what is $ for?
2098 for cookie in self: