RFE: function to dump cookie

Bug #240685 reported by Stephan Ruegamer on 2008-06-17
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Medium
Unassigned

Bug Description

Dear Colleagues,

please add some functionality to store the cookie received when useing Bug.authentication dict.

Thx :)

\sh

PS: Filed On behalf of Markus :)

Markus Korn (thekorn) on 2008-06-17
Changed in python-launchpad-bugs:
importance: Undecided → Medium
milestone: none → intrepid
status: New → Confirmed
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

Stephan Ruegamer (sadig) wrote :

Hi Markus,

worked perfectly :)

Markus Korn (thekorn) wrote :

------------------------------------------------------------
revno: 100
committer: Markus Korn <email address hidden>
branch nick: main
timestamp: Tue 2008-06-17 19:21:46 +0200
message:
  launchpadbugs/http_connection.py: added HTTPConnection.save_cookie()
  to dump LP-authentication-cookie to a file (LP: #240685)
------------------------------------------------------------

Changed in python-launchpad-bugs:
status: Confirmed → Fix Committed
Stephan Ruegamer (sadig) wrote :

Done

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers