From 6d5d623e62e1758c4f9402ff247eaeb9f1f5bda3 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Tue, 13 Jan 2009 21:43:14 +0000 Subject: [PATCH] * doc/manage-credentials.1: Written up. * common.py: Change default location of our credentials to ~/.lp_credentials.txt and service to edge. * requestsync.1: Change as necessary to launchpadlib. --- common.py | 6 ++-- debian/changelog | 2 ++ doc/manage-credentials.1 | 74 ++++++++++++++++++++++++++++++++++++++++ doc/requestsync.1 | 14 ++++---- manage-credentials | 2 +- requestsync | 1 + 6 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 doc/manage-credentials.1 diff --git a/common.py b/common.py index 9c054a8..40a0bca 100644 --- a/common.py +++ b/common.py @@ -299,12 +299,12 @@ def get_credentials(consumer, cred_file=None, level=None): if "LPCREDENTIALS" in os.environ: files.append(os.environ["LPCREDENTIALS"]) files.extend([ - os.path.join(os.getcwd(), "lp_credentials.txt"), - os.path.expanduser("~/lp_credentials.txt"), + os.path.join(os.getcwd(), ".lp_credentials.txt"), + os.path.expanduser("~/.lp_credentials.txt"), ]) return find_credentials(consumer, files, level) -def get_launchpad(consumer, server=STAGING_SERVICE_ROOT, cache=None, +def get_launchpad(consumer, server=EDGE_SERVICE_ROOT, cache=None, cred_file=None, level=None): credentials = get_credentials(consumer, cred_file, level) cache = cache or os.environ.get("LPCACHE", None) diff --git a/debian/changelog b/debian/changelog index d620976..df154e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,8 @@ ubuntu-dev-tools (0.52) UNRELEASED; urgency=low 'status'. * requestsync: If package is new, check the Ubuntu Archive team's bug list for possible duplicate requests. + * doc/manage-credentials.1: Written up. + * doc/requestsync.1: Changed documentation to launchpadlib related-stuff. [ Luca Falavigna ] * requestsync: diff --git a/doc/manage-credentials.1 b/doc/manage-credentials.1 new file mode 100644 index 0000000..74cc583 --- /dev/null +++ b/doc/manage-credentials.1 @@ -0,0 +1,74 @@ +.TH MANAGE-CREDENTIALS "1" "13 January 2009" "ubuntu-dev-tools" +.SH NAME +manage-credentials \- a tool to create (and manage) credentials which +are used to access launchpad via the API. +.SH SYNOPSIS +.B manage-credentials create -c [--email --password ] [--service ] +.br +.B manage-credentials \-h +.SH DESCRIPTION +\fBmanage-credentials\fR is a tool to create (and manage) credentials which +are used to access Launchpad via the API. + +.PP +Currently this tool can be used +to create a token with or without using the web UI. In the future, once +related methods are available through the API, this tool can also be used +to manage tokens in launchpad and on the users local machine. + +.SH OPTIONS +Listed below are the command line options for requestsync: +.TP +.B \-h +Display a help message and exit. +.TP +.B \-c \-\-consumer +.TP +.B \-e \-\-email +Your email address as registered on Launchpad. +.TP +.B \-p \-\-password +Your Launchpad password. +.TP +.B \-s \-\-service +If we should use the edge or staging root of the Launchpad API. +.TP +.B \-\-cache +Where to store the cache. +.TP +.B \-o +Which file we should save the credentials to. +.TP +.B \-l \-\-level +A number representing the access-level you wish to give to the new +Launchpad token. 0 is unauthorized, 1 is read public data, 2; write public data, +3; read private data and 4; write private data. + +.SH EXAMPLE USAGE +There are currently two ways of using \fBmanage-credentials\fR to get +Launchpad tokens. +.TP +1) manage-credentials create -c CONSUMER --level 2 + +.TP +This way shall open your webbrowser with a Launchpad login page. + +.TP +2) manage-credentials create -c CONSUMER --level 2 --password BOO --email me@example.com + +.TP +This is a hack, but it works and does not require a webbrowser . + +.TP +If you intend to use manage-credentials for Ubuntu development (such as +the ubuntu-dev-tools package). Please by sure to run the following: + +.TP +manage-credentials create -c ubuntu-dev-tools -o ~/.lp_credentials.txt + +.SH AUTHOR +.B manage-credentials +was written by Markus Korn and this manual page was written by +Jonathan Davies . +.PP +Both are released under the GNU General Public License, version 3. diff --git a/doc/requestsync.1 b/doc/requestsync.1 index 27e47d6..ef8db6b 100644 --- a/doc/requestsync.1 +++ b/doc/requestsync.1 @@ -15,10 +15,10 @@ The changelog entry is then downloaded from packages.debian.org. If the sync request is being filed per email (default), a prompt for your GPG passphrase follows so that it can sign the mail and send it off to Launchpad. -Alternatively a sync request can be filed directly using the launchpadbugs -python module (option \fB\-\-lp\fR). +Alternatively a sync request can be filed directly using the launchpadlib +Python module (option \fB\-\-lp\fR). \fBrequestsync\fR falls back to mail the sync request if submitting using -the launchpadbugs module fails. +the launchpadlib module fails. .PP \fBrequestsync\fR checks if you have the permissions to request the sync from @@ -29,10 +29,8 @@ If you are not a member of the appropriate team, the script will subscribe the necessary team with approval rights to the bug report for you. .PP -\fBrequestsync\fR uses a cookie file stored at \fI~/.lpcookie.txt\fR to -authenticate with Launchpad. -This cookie is created on run from the Mozilla Firefox cookie file at -\fI~/.mozilla/*/*/cookies.sqlite\fR. +\fBrequestsync\fR uses launchpadlib authentication to file its requests. Please +see manage-credentials(1) for more information. .SH OPTIONS Listed below are the command line options for requestsync: @@ -55,7 +53,7 @@ configuration (for example: \fI$HOME/.bashrc\fR). This is only used if the sync request is mailed to Launchpad. .TP .B \-\-lp -Use the launchpadbugs python module (packaged as python\-launchpad\-bugs) to +Use the launchpadlib Python module (packaged as python\-launchpadlib) to file the sync request in Launchpad. .TP .B \-s diff --git a/manage-credentials b/manage-credentials index 014a039..bf31c9f 100755 --- a/manage-credentials +++ b/manage-credentials @@ -45,7 +45,7 @@ class CmdOptions(OptionParser): dest="output", default=None), make_option("-l", "--level", action="store", type="int", dest="level", default=0, - help="integer representing the access-level (default: 0), mappping: %s" %LEVEL), + help="integer representing the access-level (default: 0), mapping: %s" %LEVEL), ) TOOLS = { diff --git a/requestsync b/requestsync index c500eb7..cd2f954 100755 --- a/requestsync +++ b/requestsync @@ -9,6 +9,7 @@ # Daniel Hahler # Iain Lane # Jonathan Davies +# Markus Korn (python-launchpadlib support) # # ################################################################## #