Stylistic updates.

This commit is contained in:
Jeremy Fincher 2004-01-04 13:49:51 +00:00
parent a10900da83
commit 881a2e000d

View File

@ -56,16 +56,19 @@ import callbacks
import structures import structures
import configurable import configurable
statusKeys = ['unconfirmed', 'new', 'assigned', 'reopened', 'resolved', \ statusKeys = ['unconfirmed', 'new', 'assigned', 'reopened', 'resolved',
'verified', 'closed'] 'verified', 'closed']
resolutionKeys = ['fixed', 'invalid', 'worksforme', 'needinfo', \ resolutionKeys = ['fixed', 'invalid', 'worksforme', 'needinfo',
'test-request', 'wontfix', 'cantfix', 'moved', 'duplicate', 'remind', 'later'] 'test-request', 'wontfix', 'cantfix', 'moved', 'duplicate',
resolutionKeys += ['notabug', 'notgnome', 'incomplete', 'gnome1.x', 'moved' ] 'remind', 'later', 'notabug', 'notgnome', 'incomplete',
priorityKeys = ['p1', 'p2', 'p3', 'p4', 'p5'] 'gnome1.x', 'moved']
priorityKeys += ['Low', 'Normal', 'High', 'Immediate', 'Urgent'] priorityKeys = ['p1', 'p2', 'p3', 'p4', 'p5', 'Low', 'Normal', 'High',
severityKeys = ['enhancement', 'trivial', 'minor', 'normal', 'major', \ 'Immediate', 'Urgent']
severityKeys = ['enhancement', 'trivial', 'minor', 'normal', 'major',
'critical', 'blocker'] 'critical', 'blocker']
dbfilename = os.path.join(conf.dataDir, 'Bugzilla.db') dbfilename = os.path.join(conf.dataDir, 'Bugzilla.db')
def makeDb(filename): def makeDb(filename):
if os.path.exists(filename): if os.path.exists(filename):
d = structures.PersistentDictionary(filename) d = structures.PersistentDictionary(filename)
@ -79,10 +82,12 @@ def makeDb(filename):
d.flush() d.flush()
return d return d
class BugzillaError(Exception): class BugzillaError(Exception):
"""A bugzilla error""" """A bugzilla error"""
pass pass
def configure(onStart, afterConnect, advanced): def configure(onStart, afterConnect, advanced):
from questions import expect, anything, yn from questions import expect, anything, yn
onStart.append('load Bugzilla') onStart.append('load Bugzilla')
@ -95,6 +100,7 @@ def configure(onStart, afterConnect, advanced):
replyNoBugzilla = 'I don\'t have a bugzilla %r' replyNoBugzilla = 'I don\'t have a bugzilla %r'
class Bugzilla(callbacks.PrivmsgCommandAndRegexp, configurable.Mixin): class Bugzilla(callbacks.PrivmsgCommandAndRegexp, configurable.Mixin):
"""Show a link to a bug report with a brief description""" """Show a link to a bug report with a brief description"""
threaded = True threaded = True
@ -130,9 +136,8 @@ class Bugzilla(callbacks.PrivmsgCommandAndRegexp, configurable.Mixin):
query.append('ctype=csv') query.append('ctype=csv')
return query return query
def die(self): def die(self):
configurable.Mixin.die(self)
self.db.close() self.db.close()
del self.db configurable.Mixin.die(self)
def add(self, irc, msg, args): def add(self, irc, msg, args):
"""<name> <url> <description> """<name> <url> <description>