mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-25 01:41:08 +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
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# The author of this script is unknown
|
# The author of this script is unknown
|
||||||
# License: Public Domain
|
# License: Public Domain
|
||||||
#
|
#
|
||||||
@ -63,5 +64,3 @@ find_main(pkg,0)
|
|||||||
for j in packages:
|
for j in packages:
|
||||||
if packages[(j)] == "Not in main":
|
if packages[(j)] == "Not in main":
|
||||||
print j + ": "+packages[(j)]
|
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) ]
|
[ Siegfried-Angel Gevatter Pujals (RainCT) ]
|
||||||
* Add get-build-deps and it's documentation.
|
* 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
|
-- Siegfried-Angel Gevatter Pujals (RainCT) <sgevatter@ubuntu.cat> Sat, 27 Oct 2007 23:03:42 +0200
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2007 (C) Canonical Ltd.
|
# Copyright 2007 (C) Canonical Ltd.
|
||||||
# Created by Daniel Holbach <daniel.holbach@ubuntu.com>
|
# Created by Daniel Holbach <daniel.holbach@ubuntu.com>
|
||||||
# License: GPLv3
|
# License: GPLv3
|
||||||
|
11
hugdaylist
11
hugdaylist
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright 2007, Canonical, Daniel Holbach
|
# Copyright 2007, Canonical, Daniel Holbach
|
||||||
#
|
#
|
||||||
@ -18,6 +19,7 @@ import string
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import launchpadbugs.connector as Connector
|
import launchpadbugs.connector as Connector
|
||||||
|
import launchpadbugs.bughelper_error as ConnectorErrors
|
||||||
BugList = Connector.ConnectBugList()
|
BugList = Connector.ConnectBugList()
|
||||||
Bug = Connector.ConnectBug()
|
Bug = Connector.ConnectBug()
|
||||||
except:
|
except:
|
||||||
@ -38,6 +40,9 @@ def check_args():
|
|||||||
|
|
||||||
if sys.argv[1] == "-n":
|
if sys.argv[1] == "-n":
|
||||||
howmany = int(sys.argv[2])
|
howmany = int(sys.argv[2])
|
||||||
|
if len(sys.argv) < 4:
|
||||||
|
print USAGE
|
||||||
|
sys.exit(1)
|
||||||
url = sys.argv[3]
|
url = sys.argv[3]
|
||||||
else:
|
else:
|
||||||
url = sys.argv[1]
|
url = sys.argv[1]
|
||||||
@ -59,7 +64,13 @@ def filter_unsolved(bugs):
|
|||||||
def main():
|
def main():
|
||||||
(howmany, url) = check_args()
|
(howmany, url) = check_args()
|
||||||
|
|
||||||
|
try:
|
||||||
l = BugList(url).filter(func=[filter_unsolved])
|
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:
|
if not l.bugs:
|
||||||
print "BugList of %s is empty." % url
|
print "BugList of %s is empty." % url
|
||||||
|
1
massfile
1
massfile
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# (C) Canonical, 2007, GPL v3
|
# (C) Canonical, 2007, GPL v3
|
||||||
|
|
||||||
|
1
ppaput
1
ppaput
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# Copyright 2007, Canonical, Daniel Holbach
|
# Copyright 2007, Canonical, Daniel Holbach
|
||||||
#
|
#
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# (C) 2007 Canonical Ltd, Steve Kowalik
|
# (C) 2007 Canonical Ltd, Steve Kowalik
|
||||||
# Authors:
|
# Authors:
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
#
|
#
|
||||||
# submittodebian - tool to submit patches to Debian's bts
|
# submittodebian - tool to submit patches to Debian's bts
|
||||||
# Copyright (C) 2007 Canonical Ltd.
|
# Copyright (C) 2007 Canonical Ltd.
|
||||||
@ -18,11 +19,15 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
|
||||||
from debian_bundle.changelog import Changelog
|
|
||||||
import re, os, sys
|
import re, os, sys
|
||||||
from tempfile import mkstemp
|
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):
|
def get_most_recent_debian_version(changelog):
|
||||||
for v in changelog.get_versions():
|
for v in changelog.get_versions():
|
||||||
if not re.search('(ubuntu|build)', v.full_version):
|
if not re.search('(ubuntu|build)', v.full_version):
|
||||||
@ -54,9 +59,12 @@ def gen_debdiff(changelog):
|
|||||||
|
|
||||||
return debdiff
|
return debdiff
|
||||||
|
|
||||||
def check_file(fname):
|
def check_file(fname, critical = True):
|
||||||
if not os.path.exists(fname):
|
if os.path.exists(fname):
|
||||||
print "Couldn't find %s\n" % fname
|
return fname
|
||||||
|
else:
|
||||||
|
if not critical: return False
|
||||||
|
print "Couldn't find «%s».\n" % fname
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def edit_debdiff(debdiff):
|
def edit_debdiff(debdiff):
|
||||||
@ -72,9 +80,8 @@ def run_cmd(cmd):
|
|||||||
print "%s\n" % cmd
|
print "%s\n" % cmd
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
|
|
||||||
check_file('debian/changelog')
|
changelog_file = check_file('debian/changelog', critical = no) or check_file('../debian/changelog')
|
||||||
|
changelog = Changelog(file(changelog_file).read())
|
||||||
changelog = Changelog(file('debian/changelog').read())
|
|
||||||
|
|
||||||
deb_version = get_most_recent_debian_version(changelog)
|
deb_version = get_most_recent_debian_version(changelog)
|
||||||
bug_body = get_bug_body(changelog)
|
bug_body = get_bug_body(changelog)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user