mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-13 01:41:29 +00:00
* massfile: Use the functions in the common.py file above to authenticate with
Launchpad.
This commit is contained in:
parent
00b3977dd8
commit
615bf224cc
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -23,6 +23,9 @@ ubuntu-dev-tools (0.37ubuntu1) intrepid; urgency=low
|
|||||||
the ubuntu-dev team on Launchpad. Thus, checking if the user needs
|
the ubuntu-dev team on Launchpad. Thus, checking if the user needs
|
||||||
sponsership or not (LP: #130648).
|
sponsership or not (LP: #130648).
|
||||||
* doc/requestsync.1: Removed mention of -s flag. Obsoleted by the above.
|
* doc/requestsync.1: Removed mention of -s flag. Obsoleted by the above.
|
||||||
|
* massfile:
|
||||||
|
- Use the functions in the common.py file above to authenticate with
|
||||||
|
Launchpad.
|
||||||
* debian/control: Changed XS-Python-Version to >= 2.5.
|
* debian/control: Changed XS-Python-Version to >= 2.5.
|
||||||
|
|
||||||
[ Siegfried-Angel Gevatter Pujals ]
|
[ Siegfried-Angel Gevatter Pujals ]
|
||||||
|
34
massfile
34
massfile
@ -85,6 +85,12 @@ def check_configfiles():
|
|||||||
|
|
||||||
def file_bug(config):
|
def file_bug(config):
|
||||||
Bug = Connector.ConnectBug()
|
Bug = Connector.ConnectBug()
|
||||||
|
|
||||||
|
sys.path.append('/usr/share/ubuntu-dev-tools/')
|
||||||
|
import common
|
||||||
|
|
||||||
|
cookie = common.prepareLaunchpadCookie()
|
||||||
|
|
||||||
Bug.authentication = cookie
|
Bug.authentication = cookie
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -122,39 +128,11 @@ def read_buglist(url):
|
|||||||
packages.add(bug.sourcepackage)
|
packages.add(bug.sourcepackage)
|
||||||
|
|
||||||
return packages
|
return packages
|
||||||
|
|
||||||
def lp_cookie():
|
|
||||||
global cookie
|
|
||||||
cookie = None
|
|
||||||
|
|
||||||
# Search cookiefile (for authentication to lp)
|
|
||||||
if cookie == None:
|
|
||||||
try_globs = ('~/.lpcookie.txt', '~/.mozilla/*/*/cookies.sqlite', '~/.mozilla/*/*/cookies.txt')
|
|
||||||
for try_glob in try_globs:
|
|
||||||
try:
|
|
||||||
cookiefile = glob.glob(os.path.expanduser(try_glob))[0]
|
|
||||||
except IndexError:
|
|
||||||
continue
|
|
||||||
# Found:
|
|
||||||
print "Using cookie file at «%s».\n" % cookiefile
|
|
||||||
cookie = cookiefile
|
|
||||||
break
|
|
||||||
|
|
||||||
if cookie == None:
|
|
||||||
raise RuntimeError("Could not find cookie file for Launchpad \
|
|
||||||
(looked in %s). You should be able to create a valid file by logging into \
|
|
||||||
Launchpad with Firefox") % ", ".join(try_globs)
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if not check_configfiles():
|
if not check_configfiles():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
|
||||||
lp_cookie()
|
|
||||||
except RuntimeError, e:
|
|
||||||
print e
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
config = read_config()
|
config = read_config()
|
||||||
pack_list = read_list()
|
pack_list = read_list()
|
||||||
buglist = read_buglist(config["buglist-url"])
|
buglist = read_buglist(config["buglist-url"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user