mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 01:21:07 +00:00
Drop hack method from manage-credentials
This commit is contained in:
commit
4140992fab
@ -47,23 +47,16 @@ Launchpad token. 0 is unauthorized, 1 is read public data, 2; write public data,
|
|||||||
3; read private data and 4; write private data.
|
3; read private data and 4; write private data.
|
||||||
|
|
||||||
.SH EXAMPLE USAGE
|
.SH EXAMPLE USAGE
|
||||||
There are currently two ways of using \fBmanage-credentials\fR to get
|
To get Launchpad tokens using \fBmanage-credentials\fR, run the following command:
|
||||||
Launchpad tokens.
|
|
||||||
.TP
|
.TP
|
||||||
1) manage-credentials create \-c CONSUMER \-\-level 2
|
manage-credentials create \-c CONSUMER \-\-level 2
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
This way shall open your webbrowser with a Launchpad login page.
|
This will open your web browser 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
|
.TP
|
||||||
If you intend to use manage-credentials for Ubuntu development (such as
|
If you intend to use manage-credentials for Ubuntu development (such as
|
||||||
the ubuntu-dev-tools package). Please by sure to run the following:
|
the ubuntu-dev-tools package). Please be sure to run the following:
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
manage-credentials create \-c ubuntu-dev-tools \-l 2
|
manage-credentials create \-c ubuntu-dev-tools \-l 2
|
||||||
|
@ -23,21 +23,17 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from optparse import OptionParser, make_option
|
from optparse import OptionParser, make_option
|
||||||
from launchpadlib.uris import lookup_service_root
|
from launchpadlib.uris import lookup_service_root
|
||||||
from ubuntutools.lp.libsupport import *
|
from ubuntutools.lp.libsupport import Launchpad, translate_web_api, LEVEL
|
||||||
|
|
||||||
class CmdOptions(OptionParser):
|
class CmdOptions(OptionParser):
|
||||||
|
|
||||||
USAGE = (
|
USAGE = (
|
||||||
"\t%prog create -c <consumer> [--email <email> --password <password>] [--service <staging|edge>]"
|
"\t%prog create -c <consumer> [--service <staging|edge>]"
|
||||||
)
|
)
|
||||||
|
|
||||||
OPTIONS = (
|
OPTIONS = (
|
||||||
make_option("-c", "--consumer", action="store", type="string",
|
make_option("-c", "--consumer", action="store", type="string",
|
||||||
dest="consumer", default=None),
|
dest="consumer", default=None),
|
||||||
make_option("-e", "--email", action="store", type="string",
|
|
||||||
dest="email", default=None),
|
|
||||||
make_option("-p", "--password", action="store", type="string",
|
|
||||||
dest="password", default=None),
|
|
||||||
make_option("-s", "--service", action="store", type="string",
|
make_option("-s", "--service", action="store", type="string",
|
||||||
dest="service", default="edge"),
|
dest="service", default="edge"),
|
||||||
make_option("--cache", action="store", type="string",
|
make_option("--cache", action="store", type="string",
|
||||||
@ -51,7 +47,7 @@ class CmdOptions(OptionParser):
|
|||||||
|
|
||||||
TOOLS = {
|
TOOLS = {
|
||||||
"create": ( ("consumer",),
|
"create": ( ("consumer",),
|
||||||
("email", "password", "service", "cache", "output",
|
("service", "cache", "output",
|
||||||
"level")),
|
"level")),
|
||||||
"list": (tuple(), ("service", )),
|
"list": (tuple(), ("service", )),
|
||||||
}
|
}
|
||||||
@ -88,17 +84,10 @@ class CmdOptions(OptionParser):
|
|||||||
return tool, options
|
return tool, options
|
||||||
|
|
||||||
def create_credentials(options):
|
def create_credentials(options):
|
||||||
if options.password and options.email:
|
launchpad = Launchpad.get_token_and_login(options.consumer,
|
||||||
# use hack
|
options.service, options.cache)
|
||||||
credentials = Credentials(options.consumer)
|
credentials = launchpad.credentials
|
||||||
credentials = approve_application(credentials, options.email,
|
|
||||||
options.password, options.level,
|
|
||||||
translate_api_web(options.service), None)
|
|
||||||
else:
|
|
||||||
launchpad = Launchpad.get_token_and_login(options.consumer,
|
|
||||||
options.service, options.cache)
|
|
||||||
credentials = launchpad.credentials
|
|
||||||
|
|
||||||
if options.output:
|
if options.output:
|
||||||
filepath = options.output
|
filepath = options.output
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user