Small style fixes.

This commit is contained in:
Jeremy Fincher 2004-09-12 04:34:59 +00:00
parent 33bb2e7347
commit 63cb4b9e6e

View File

@ -30,8 +30,8 @@
### ###
""" """
Provides an interface to the wonders of UrbanDictionary.com Provides an interface to the wonders of UrbanDictionary.com. This may include
'Not appropriate for all audiences' some offensive definitions.
""" """
__revision__ = "$Id$" __revision__ = "$Id$"
@ -62,15 +62,16 @@ conf.registerPlugin('UrbanDict')
class UrbanDict(callbacks.Privmsg): class UrbanDict(callbacks.Privmsg):
threaded = True threaded = True
callBefore = ['URL'] callBefore = ['URL']
def callCommand(self, method, irc, msg, *L, **kwargs): def callCommand(self, method, irc, msg, *L, **kwargs):
try: try:
super(UrbanDict, self).callCommand(method, irc, msg, *L, **kwargs) super(UrbanDict, self).callCommand(method, irc, msg, *L, **kwargs)
except webutils.WebError, e: except webutils.WebError, e:
irc.error(str(e)) irc.error(str(e))
_wordRE = re.compile('<title>UrbanDictionary.com/(?P<word>.*?)</title>') _wordRE = re.compile(r'<title>UrbanDictionary.com/(?P<word>.*?)</title>')
_defUsageRE = re.compile('<blockquote><p>(?P<definition>.*?)</p><p><i>(?P<usage>.*?)</i></p>', re.MULTILINE | re.DOTALL) _defUsageRE = re.compile(r'<blockquote><p>(?P<definition>.*?)</p>'
r'<p><i>(?P<usage>.*?)</i></p>',
re.MULTILINE | re.DOTALL)
def ud(self, irc, msg, args): def ud(self, irc, msg, args):
"""[<phrase>] """[<phrase>]