* 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.
This commit is contained in:
Jonathan Davies 2009-01-13 21:43:14 +00:00
parent 2270f133cb
commit 6d5d623e62
6 changed files with 87 additions and 12 deletions

View File

@ -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)

2
debian/changelog vendored
View File

@ -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:

74
doc/manage-credentials.1 Normal file
View File

@ -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 <consumer> [--email <email> --password <password>] [--service <staging|edge>]
.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 <email>
Your email address as registered on Launchpad.
.TP
.B \-p \-\-password <password>
Your Launchpad password.
.TP
.B \-s \-\-service <edge|staging>
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 <number>
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 <thekorn@gmx.de> and this manual page was written by
Jonathan Davies <jpds@ubuntu.com>.
.PP
Both are released under the GNU General Public License, version 3.

View File

@ -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

View File

@ -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 = {

View File

@ -9,6 +9,7 @@
# Daniel Hahler <ubuntu@thequod.de>
# Iain Lane <iain@orangesquash.org.uk>
# Jonathan Davies <jpds@ubuntu.com>
# Markus Korn <thekorn@gmx.de> (python-launchpadlib support)
#
# ##################################################################
#