Return cookies as a string of "\\n"-separated "Set-Cookie3" headers. ignore_discard and ignore_expires: see docstring for FileCookieJar.save
(self, ignore_discard=True, ignore_expires=True)
| 1871 | """ |
| 1872 | |
| 1873 | def as_lwp_str(self, ignore_discard=True, ignore_expires=True): |
| 1874 | """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers. |
| 1875 | |
| 1876 | ignore_discard and ignore_expires: see docstring for FileCookieJar.save |
| 1877 | |
| 1878 | """ |
| 1879 | now = time.time() |
| 1880 | r = [] |
| 1881 | for cookie in self: |
| 1882 | if not ignore_discard and cookie.discard: |
| 1883 | continue |
| 1884 | if not ignore_expires and cookie.is_expired(now): |
| 1885 | continue |
| 1886 | r.append("Set-Cookie3: %s" % lwp_cookie_str(cookie)) |
| 1887 | return "\n".join(r+[""]) |
| 1888 | |
| 1889 | def save(self, filename=None, ignore_discard=False, ignore_expires=False): |
| 1890 | if filename is None: |
no test coverage detected