mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 15:41:09 +00:00
Error handlign improvements in different scripts.
This commit is contained in:
parent
61174665ad
commit
e30595f81d
3
404main
3
404main
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# The author of this script is unknown
|
||||
# License: Public Domain
|
||||
#
|
||||
@ -63,5 +64,3 @@ find_main(pkg,0)
|
||||
for j in packages:
|
||||
if packages[(j)] == "Not in main":
|
||||
print j + ": "+packages[(j)]
|
||||
|
||||
|
||||
|
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -11,6 +11,10 @@ ubuntu-dev-tools (0.21) UNRELEASED; urgency=low
|
||||
|
||||
[ Siegfried-Angel Gevatter Pujals (RainCT) ]
|
||||
* Add get-build-deps and it's documentation.
|
||||
* Change the character encoding on all Python scripts to UTF-8
|
||||
* submittodebian: better changelog location detection
|
||||
* submittodebian: user-friendly error if python-debian isn't installed
|
||||
* hugdaylist: improve error handling (less backtraces, more nice messages)
|
||||
|
||||
-- Siegfried-Angel Gevatter Pujals (RainCT) <sgevatter@ubuntu.cat> Sat, 27 Oct 2007 23:03:42 +0200
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2007 (C) Canonical Ltd.
|
||||
# Created by Daniel Holbach <daniel.holbach@ubuntu.com>
|
||||
# License: GPLv3
|
||||
|
17
hugdaylist
17
hugdaylist
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2007, Canonical, Daniel Holbach
|
||||
#
|
||||
@ -18,6 +19,7 @@ import string
|
||||
|
||||
try:
|
||||
import launchpadbugs.connector as Connector
|
||||
import launchpadbugs.bughelper_error as ConnectorErrors
|
||||
BugList = Connector.ConnectBugList()
|
||||
Bug = Connector.ConnectBug()
|
||||
except:
|
||||
@ -35,13 +37,16 @@ def check_args():
|
||||
if len(sys.argv) < 2:
|
||||
print >> sys.stderr, USAGE
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if sys.argv[1] == "-n":
|
||||
howmany = int(sys.argv[2])
|
||||
if len(sys.argv) < 4:
|
||||
print USAGE
|
||||
sys.exit(1)
|
||||
url = sys.argv[3]
|
||||
else:
|
||||
url = sys.argv[1]
|
||||
|
||||
|
||||
return (howmany, url)
|
||||
|
||||
def filter_unsolved(bugs):
|
||||
@ -59,7 +64,13 @@ def filter_unsolved(bugs):
|
||||
def main():
|
||||
(howmany, url) = check_args()
|
||||
|
||||
l = BugList(url).filter(func=[filter_unsolved])
|
||||
try:
|
||||
l = BugList(url).filter(func=[filter_unsolved])
|
||||
except ConnectorErrors.LPUrlError:
|
||||
print "Couldn't load «%s»." % url
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1) # User aborted, no need to print a backtrace
|
||||
|
||||
if not l.bugs:
|
||||
print "BugList of %s is empty." % url
|
||||
|
1
massfile
1
massfile
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# (C) Canonical, 2007, GPL v3
|
||||
|
||||
|
1
ppaput
1
ppaput
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# Copyright 2007, Canonical, Daniel Holbach
|
||||
#
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# (C) 2007 Canonical Ltd, Steve Kowalik
|
||||
# Authors:
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# submittodebian - tool to submit patches to Debian's bts
|
||||
# Copyright (C) 2007 Canonical Ltd.
|
||||
@ -18,11 +19,15 @@
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
|
||||
from debian_bundle.changelog import Changelog
|
||||
import re, os, sys
|
||||
from tempfile import mkstemp
|
||||
|
||||
try:
|
||||
from debian_bundle.changelog import Changelog
|
||||
except ImportError:
|
||||
print 'This utility requires modules from the «python-debian» package, which isn\'t currently installed.'
|
||||
sys.exit(1)
|
||||
|
||||
def get_most_recent_debian_version(changelog):
|
||||
for v in changelog.get_versions():
|
||||
if not re.search('(ubuntu|build)', v.full_version):
|
||||
@ -54,11 +59,14 @@ def gen_debdiff(changelog):
|
||||
|
||||
return debdiff
|
||||
|
||||
def check_file(fname):
|
||||
if not os.path.exists(fname):
|
||||
print "Couldn't find %s\n" % fname
|
||||
def check_file(fname, critical = True):
|
||||
if os.path.exists(fname):
|
||||
return fname
|
||||
else:
|
||||
if not critical: return False
|
||||
print "Couldn't find «%s».\n" % fname
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def edit_debdiff(debdiff):
|
||||
cmd = 'sensible-editor %s' % (debdiff)
|
||||
run_cmd(cmd)
|
||||
@ -72,9 +80,8 @@ def run_cmd(cmd):
|
||||
print "%s\n" % cmd
|
||||
os.system(cmd)
|
||||
|
||||
check_file('debian/changelog')
|
||||
|
||||
changelog = Changelog(file('debian/changelog').read())
|
||||
changelog_file = check_file('debian/changelog', critical = no) or check_file('../debian/changelog')
|
||||
changelog = Changelog(file(changelog_file).read())
|
||||
|
||||
deb_version = get_most_recent_debian_version(changelog)
|
||||
bug_body = get_bug_body(changelog)
|
||||
|
Loading…
x
Reference in New Issue
Block a user