Comment 1 for bug 240685

Revision history for this message
Markus Korn (thekorn) wrote :

This patch against .main rev 99 adds a save_cookie-method to the HTTPConnection object:

Example usage:

In [1]: from launchpadbugs.connector import ConnectBug

In [2]: Bug = ConnectBug()

In [3]: Bug.connection.save_cookie("boo")

In [4]: !cat boo
    # Netscape HTTP Cookie File
    # http://www.netscape.com/newsref/std/cookie_spec.html
    # This is a generated file! Do not edit.

In [5]: Bug.authentication = {"email": "myemail", "password": "mypassword"}

In [6]: Bug.connection.save_cookie("boo")

In [7]: !cat boo
    # Netscape HTTP Cookie File
    # http://www.netscape.com/newsref/std/cookie_spec.html
    # This is a generated file! Do not edit.

.launchpad.net TRUE / TRUE 123456789 edge somerandomstring
.launchpad.net TRUE / TRUE 123456789 lp somerandomstring

the created file is in the mozilla format used with FF2 since python does not support the new format directly.

Please test and review this patch.

Markus