* Converted everything else.

This commit is contained in:
Jonathan Davies 2009-01-19 18:10:53 +00:00
parent 6f0f40360f
commit 32f8e2b2bc
7 changed files with 25 additions and 20 deletions

6
debian/changelog vendored
View File

@ -1,8 +1,10 @@
ubuntu-dev-tools (0.60) UNRELEASED; urgency=low ubuntu-dev-tools (0.60) UNRELEASED; urgency=low
* Changes go here. * ubuntutools/common.py: Now split into multiple files depending on
function.
* Adjusted imports on all files as necessary for the change above.
-- Loic Minier <lool@dooz.org> Mon, 19 Jan 2009 18:13:18 +0100 -- Jonathan Davies <jpds@ubuntu.com> Mon, 19 Jan 2009 18:00:15 +0000
ubuntu-dev-tools (0.59) jaunty; urgency=low ubuntu-dev-tools (0.59) jaunty; urgency=low

View File

@ -20,7 +20,7 @@
import os import os
import sys import sys
from ubuntutools.common import get_launchpad from ubuntutools.lplibsupport import get_launchpad
USAGE = "grab-attachments <bug numbers>" USAGE = "grab-attachments <bug numbers>"

View File

@ -35,7 +35,7 @@ import string
import sys import sys
from optparse import OptionParser from optparse import OptionParser
from ubuntutools.common import get_launchpad, translate_web_api, translate_api_web from ubuntutools.lplibsupport import get_launchpad, translate_web_api, translate_api_web
def check_args(): def check_args():
howmany = -1 howmany = -1

View File

@ -25,7 +25,7 @@
import os, sys import os, sys
from optparse import OptionParser from optparse import OptionParser
from ubuntutools import common from ubuntutools import lplibsupport
def die(message): def die(message):
print >> sys.stderr, "Fatal: " + message print >> sys.stderr, "Fatal: " + message
@ -46,7 +46,7 @@ if __name__ == '__main__':
launchpad = None launchpad = None
try: try:
print "Setting up Launchpad" print "Setting up Launchpad"
launchpad = common.get_launchpad("ubuntu-dev-tools") launchpad = lplibsupport.get_launchpad("ubuntu-dev-tools")
print "Launchpad setup complete" print "Launchpad setup complete"
except ImportError: except ImportError:
suggestion = "check whether python-launchpadlib is installed" suggestion = "check whether python-launchpadlib is installed"

View File

@ -6,6 +6,8 @@
# Modified by Iain Lane <iain@orangesquash.org.uk>, taking some code written by # Modified by Iain Lane <iain@orangesquash.org.uk>, taking some code written by
# Daniel Hahler <ubuntu@thequod.de> # Daniel Hahler <ubuntu@thequod.de>
# #
# python-launchpadlib support was added by Markus Korn <thekorn@gmx.de>.
#
# ################################################################## # ##################################################################
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
@ -27,7 +29,7 @@ import email
import subprocess import subprocess
import glob import glob
from ubuntutools.common import get_launchpad, translate_api_web, translate_web_api from ubuntutools.lplibsupport import get_launchpad, translate_api_web, translate_web_api
def read_config(): def read_config():
instructions_file = open("instructions") instructions_file = open("instructions")

View File

@ -33,7 +33,7 @@ import urllib2
from optparse import OptionParser from optparse import OptionParser
# Ubuntu-dev-tools modules. # Ubuntu-dev-tools modules.
from ubuntutools import common from ubuntutools import packages
class BackportFromLP: class BackportFromLP:
@ -65,10 +65,7 @@ if __name__ == '__main__':
optParser = OptionParser(usage) optParser = OptionParser(usage)
(options, args) = optParser.parse_args() (options, args) = optParser.parse_args()
if not args: if not args: optParser.error("Arguments required.")
print >> sys.stderr, "Need arguments."
optParser.print_help()
sys.exit(1)
package = str(args[0]).lower() package = str(args[0]).lower()
@ -79,10 +76,10 @@ if __name__ == '__main__':
# Correct-ish args, can proceed. # Correct-ish args, can proceed.
# Check release by checking if Launchpad page exists # Check release by checking if Launchpad page exists
common.checkReleaseExists(release) packages.checkReleaseExists(release)
# Check package exists. # Check package exists.
common.checkSourceExists(package, release) packages.checkSourceExists(package, release)
# All good - start downloading... # All good - start downloading...
try: try:

View File

@ -35,9 +35,13 @@ from debian_bundle.changelog import Version
from optparse import OptionParser from optparse import OptionParser
from time import sleep from time import sleep
from ubuntutools import common # ubuntu-dev-tools modules.
from ubuntutools import lpcookie
from ubuntutools import lplibfunctions
from ubuntutools import lplibsupport
from ubuntutools import lpurlopener
launchpad_cookiefile = common.prepareLaunchpadCookie() launchpad_cookiefile = lpcookie.prepareLaunchpadCookie()
def checkNeedsSponsorship(component): def checkNeedsSponsorship(component):
""" """
@ -58,7 +62,7 @@ def checkNeedsSponsorship(component):
# >>> me = launchpad.me # >>> me = launchpad.me
# >>> me.inTeam(<TEAM>) #or # >>> me.inTeam(<TEAM>) #or
# >>> me in <TEAM> # >>> me in <TEAM>
urlopener = common.setupLaunchpadUrlOpener(launchpad_cookiefile) urlopener = lpurlopener.setupLaunchpadUrlOpener(launchpad_cookiefile)
# Check where the package is and assign the appropriate variables. # Check where the package is and assign the appropriate variables.
if component in ['main', 'restricted']: if component in ['main', 'restricted']:
@ -69,7 +73,7 @@ def checkNeedsSponsorship(component):
sponsor = "ubuntu-universe-sponsors" sponsor = "ubuntu-universe-sponsors"
# Check if they are a member of the team. # Check if they are a member of the team.
teamMember = common.isLPTeamMember(team) teamMember = lplibfunctions.isLPTeamMember(team)
if not teamMember: if not teamMember:
print "You are not a member (direct or indirect) of the '%s' " \ print "You are not a member (direct or indirect) of the '%s' " \
@ -98,7 +102,7 @@ def checkExistingReports(package):
launchpad = None launchpad = None
try: try:
launchpad = common.get_launchpad("ubuntu-dev-tools") launchpad = lplibsupport.get_launchpad("ubuntu-dev-tools")
except ImportError: except ImportError:
print >> sys.stderr, 'Importing launchpadlib failed. Is ' \ print >> sys.stderr, 'Importing launchpadlib failed. Is ' \
'python-launchpadlib installed?' 'python-launchpadlib installed?'
@ -348,7 +352,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext):
import glob, os.path import glob, os.path
try: try:
launchpad = common.get_launchpad("ubuntu-dev-tools") launchpad = lplibsupport.get_launchpad("ubuntu-dev-tools")
except ImportError: except ImportError:
print >> sys.stderr, 'Importing launchpadlib failed. Is python-launchpadlib installed?' print >> sys.stderr, 'Importing launchpadlib failed. Is python-launchpadlib installed?'
return False return False