mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-22 15:51:08 +00:00
More module reorganzation.
This commit is contained in:
parent
0bbef6d974
commit
88abaa56cf
12
buildd
12
buildd
@ -31,9 +31,9 @@ from optparse import OptionParser
|
||||
from urllib import urlencode
|
||||
|
||||
# ubuntu-dev-tools modules.
|
||||
from ubuntutools import lpcookie
|
||||
from ubuntutools import lplibfunctions
|
||||
from ubuntutools import lpurlopener
|
||||
import ubuntutools.lp.cookie as lp_cookie
|
||||
import ubuntutools.lp.functions as lp_functions
|
||||
import ubuntutools.lp.urlopener as lp_urlopener
|
||||
from ubuntutools import packages
|
||||
|
||||
# Usage.
|
||||
@ -96,8 +96,8 @@ else:
|
||||
oneArch = False
|
||||
|
||||
# Prepare Launchpad cookie.
|
||||
launchpadCookie = lpcookie.prepareLaunchpadCookie()
|
||||
urlopener = lpurlopener.setupLaunchpadUrlOpener(launchpadCookie)
|
||||
launchpadCookie = lp_cookie.prepareLaunchpadCookie()
|
||||
urlopener = lp_urlopener.setupLaunchpadUrlOpener(launchpadCookie)
|
||||
|
||||
# Check the release exists.
|
||||
packages.checkReleaseExists(release)
|
||||
@ -153,7 +153,7 @@ if op == "retry":
|
||||
else:
|
||||
teamNeeded = "ubuntu-dev"
|
||||
|
||||
necessaryPrivs = lplibfunctions.isLPTeamMember(teamNeeded)
|
||||
necessaryPrivs = lp_functions.isLPTeamMember(teamNeeded)
|
||||
|
||||
if not necessaryPrivs:
|
||||
print >> sys.stderr, "You cannot perform the %s operation on a %s package " \
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ubuntutools.lplibsupport import get_launchpad
|
||||
from ubuntutools.lp.libsupport import get_launchpad
|
||||
|
||||
USAGE = "grab-attachments <bug numbers>"
|
||||
|
||||
|
@ -35,7 +35,7 @@ import string
|
||||
import sys
|
||||
from optparse import OptionParser
|
||||
|
||||
from ubuntutools.lplibsupport import get_launchpad, translate_web_api, translate_api_web
|
||||
from ubuntutools.lp.libsupport import get_launchpad, translate_web_api, translate_api_web
|
||||
|
||||
def check_args():
|
||||
howmany = -1
|
||||
|
@ -25,7 +25,7 @@
|
||||
import os, sys
|
||||
from optparse import OptionParser
|
||||
|
||||
from ubuntutools import lplibsupport
|
||||
from ubuntutools.lp.libsupport as lp_libsupport
|
||||
|
||||
def die(message):
|
||||
print >> sys.stderr, "Fatal: " + message
|
||||
@ -46,7 +46,7 @@ if __name__ == '__main__':
|
||||
launchpad = None
|
||||
try:
|
||||
print "Setting up Launchpad"
|
||||
launchpad = lplibsupport.get_launchpad("ubuntu-dev-tools")
|
||||
launchpad = lp_libsupport.get_launchpad("ubuntu-dev-tools")
|
||||
print "Launchpad setup complete"
|
||||
except ImportError:
|
||||
suggestion = "check whether python-launchpadlib is installed"
|
||||
|
@ -22,7 +22,7 @@
|
||||
import os
|
||||
import sys
|
||||
from optparse import OptionParser, make_option
|
||||
from ubuntutools.lplibsupport import *
|
||||
from ubuntutools.lp.libsupport import *
|
||||
from ubuntutools.misc import mkdir
|
||||
|
||||
class CmdOptions(OptionParser):
|
||||
|
2
massfile
2
massfile
@ -29,7 +29,7 @@ import email
|
||||
import subprocess
|
||||
import glob
|
||||
|
||||
from ubuntutools.lplibsupport import get_launchpad, translate_api_web, translate_web_api
|
||||
from ubuntutools.lp.libsupport import get_launchpad, translate_api_web, translate_web_api
|
||||
|
||||
def read_config():
|
||||
instructions_file = open("instructions")
|
||||
|
22
requestsync
22
requestsync
@ -36,12 +36,12 @@ from optparse import OptionParser
|
||||
from time import sleep
|
||||
|
||||
# ubuntu-dev-tools modules.
|
||||
from ubuntutools import lpcookie
|
||||
from ubuntutools import lplibfunctions
|
||||
from ubuntutools import lplibsupport
|
||||
from ubuntutools import lpurlopener
|
||||
import ubuntutools.lp.cookie as lp_cookie
|
||||
import ubuntutools.lp.functions as lp_functions
|
||||
import ubuntutools.lp.libsupport as lp_libsupport
|
||||
import ubuntutools.lp.urlopener as lp_urlopener
|
||||
|
||||
launchpad_cookiefile = lpcookie.prepareLaunchpadCookie()
|
||||
launchpad_cookiefile = lp_cookie.prepareLaunchpadCookie()
|
||||
|
||||
def checkNeedsSponsorship(component):
|
||||
"""
|
||||
@ -62,7 +62,7 @@ def checkNeedsSponsorship(component):
|
||||
# >>> me = launchpad.me
|
||||
# >>> me.inTeam(<TEAM>) #or
|
||||
# >>> me in <TEAM>
|
||||
urlopener = lpurlopener.setupLaunchpadUrlOpener(launchpad_cookiefile)
|
||||
urlopener = lp_urlopener.setupLaunchpadUrlOpener(launchpad_cookiefile)
|
||||
|
||||
# Check where the package is and assign the appropriate variables.
|
||||
if component in ['main', 'restricted']:
|
||||
@ -73,7 +73,7 @@ def checkNeedsSponsorship(component):
|
||||
sponsor = "ubuntu-universe-sponsors"
|
||||
|
||||
# Check if they are a member of the team.
|
||||
teamMember = lplibfunctions.isLPTeamMember(team)
|
||||
teamMember = lp_functions.isLPTeamMember(team)
|
||||
|
||||
if not teamMember:
|
||||
print "You are not a member (direct or indirect) of the '%s' " \
|
||||
@ -102,7 +102,7 @@ def checkExistingReports(package):
|
||||
launchpad = None
|
||||
|
||||
try:
|
||||
launchpad = lplibsupport.get_launchpad("ubuntu-dev-tools")
|
||||
launchpad = lp_libsupport.get_launchpad("ubuntu-dev-tools")
|
||||
except ImportError:
|
||||
print >> sys.stderr, 'Importing launchpadlib failed. Is ' \
|
||||
'python-launchpadlib installed?'
|
||||
@ -133,7 +133,7 @@ def checkExistingReports(package):
|
||||
|
||||
for bug in matchingBugs:
|
||||
print " *", bug.title
|
||||
print " -", lplibsupport.translate_api_web(bug.self_link)
|
||||
print " -", lp_libsupport.translate_api_web(bug.self_link)
|
||||
|
||||
print "Please check the above URLs to verify this before filing a " \
|
||||
"possible duplicate report."
|
||||
@ -352,7 +352,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
||||
import glob, os.path
|
||||
|
||||
try:
|
||||
launchpad = lplibsupport.get_launchpad("ubuntu-dev-tools")
|
||||
launchpad = lp_libsupport.get_launchpad("ubuntu-dev-tools")
|
||||
except ImportError:
|
||||
print >> sys.stderr, 'Importing launchpadlib failed. Is python-launchpadlib installed?'
|
||||
return False
|
||||
@ -396,7 +396,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
|
||||
bug.subscribe(person=subscribe_url)
|
||||
|
||||
print 'Sync request filed as bug #%i: %s' % (bug.id,
|
||||
lplibsupport.translate_api_web(bug.self_link))
|
||||
lp_libsupport.translate_api_web(bug.self_link))
|
||||
return True
|
||||
|
||||
def edit_report(subject, body, changes_required=False):
|
||||
|
3
ubuntutools/lp/__init__.py
Normal file
3
ubuntutools/lp/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
##
|
||||
## ubuntu-dev-tools Launchpad Python modules.
|
||||
##
|
@ -1,5 +1,5 @@
|
||||
import lpcookie
|
||||
import lpurlopener
|
||||
import cookie
|
||||
import urlopener
|
||||
|
||||
def isLPTeamMember(team):
|
||||
""" Checks if the user is a member of a certain team on Launchpad.
|
||||
@ -15,9 +15,9 @@ def isLPTeamMember(team):
|
||||
# TODO: Check if launchpadlib may be a better way of doing this.
|
||||
|
||||
# Prepare cookie.
|
||||
cookieFile = lpcookie.prepareLaunchpadCookie()
|
||||
cookieFile = cookie.prepareLaunchpadCookie()
|
||||
# Prepare URL opener.
|
||||
urlopener = lpurlopener.setupLaunchpadUrlOpener(cookieFile)
|
||||
urlopener = urlopener.setupLaunchpadUrlOpener(cookieFile)
|
||||
|
||||
# Try to open the Launchpad team page:
|
||||
try:
|
Loading…
x
Reference in New Issue
Block a user