* hugdaylist: Added code to handle exceptions.

This commit is contained in:
Jonathan Patrick Davies 2008-08-10 15:49:02 +01:00
parent f45d1724c7
commit e3afe4de77
2 changed files with 12 additions and 5 deletions

1
debian/changelog vendored
View File

@ -7,6 +7,7 @@ ubuntu-dev-tools (0.36ubuntu1) intrepid; urgency=low
- grab-attachment.1.
* doc/requestsync.1: Described variables used by requestsync in man
page. (LP: #237595)
* hugdaylist: Added code to handle exceptions.
[ Siegfried-Angel Gevatter Pujals ]
* Change the versioning scheme from 0.XX to 0.XXubuntu1. Delete

View File

@ -21,9 +21,9 @@ try:
import launchpadbugs.connector as Connector
BugList = Connector.ConnectBugList()
Bug = Connector.ConnectBug(method="Text")
except:
except ImportError:
print >> sys.stderr, \
"You need python-launchpad-bugs (>= 0.2.25) installed to use hugdaylist."
"You need python-launchpad-bugs (>= 0.2.25) installed to use hugdaylist."
sys.exit(1)
@ -38,7 +38,10 @@ def check_args():
sys.exit(1)
if sys.argv[1] == "-n":
howmany = int(sys.argv[2])
try:
howmany = int(sys.argv[2])
except IndexError:
print "Option '-n' requires a number."
if len(sys.argv) < 4:
print USAGE
sys.exit(1)
@ -82,5 +85,8 @@ def main():
if __name__ == '__main__':
main()
try:
main()
except KeyboardInterrupt:
print >> sys.stderr, "Aborted"
sys.exit(1)