MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / lwp_cookie_str

Function lwp_cookie_str

tools/python-3.11.9-amd64/Lib/http/cookiejar.py:1831–1857  ·  view source on GitHub ↗

Return string representation of Cookie in the LWP cookie file format. Actually, the format is extended a bit -- see module docstring.

(cookie)

Source from the content-addressed store, hash-verified

1829
1830
1831def lwp_cookie_str(cookie):
1832 """Return string representation of Cookie in the LWP cookie file format.
1833
1834 Actually, the format is extended a bit -- see module docstring.
1835
1836 """
1837 h = [(cookie.name, cookie.value),
1838 ("path", cookie.path),
1839 ("domain", cookie.domain)]
1840 if cookie.port is not None: h.append(("port", cookie.port))
1841 if cookie.path_specified: h.append(("path_spec", None))
1842 if cookie.port_specified: h.append(("port_spec", None))
1843 if cookie.domain_initial_dot: h.append(("domain_dot", None))
1844 if cookie.secure: h.append(("secure", None))
1845 if cookie.expires: h.append(("expires",
1846 time2isoz(float(cookie.expires))))
1847 if cookie.discard: h.append(("discard", None))
1848 if cookie.comment: h.append(("comment", cookie.comment))
1849 if cookie.comment_url: h.append(("commenturl", cookie.comment_url))
1850
1851 keys = sorted(cookie._rest.keys())
1852 for k in keys:
1853 h.append((k, str(cookie._rest[k])))
1854
1855 h.append(("version", str(cookie.version)))
1856
1857 return join_header_words([h])
1858
1859class LWPCookieJar(FileCookieJar):
1860 """

Callers 1

as_lwp_strMethod · 0.85

Calls 6

time2isozFunction · 0.85
sortedFunction · 0.85
strFunction · 0.85
join_header_wordsFunction · 0.85
appendMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected