Fixed some bugz0rs.

This commit is contained in:
Jeremy Fincher 2004-01-02 19:54:25 +00:00
parent a58e5b97d9
commit 8b6733ee5d
2 changed files with 8 additions and 6 deletions

View File

@ -217,7 +217,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp,
s = 'Title: %s' % utils.htmlToText(m.group(1).strip())
if self.configurables.get('titlesnarferincludesurl', channel):
s += ' (<%s>)' % url
irc.reply(msg, 'Title: %s' % s, prefixName=False)
irc.reply(msg, s, prefixName=False)
titleSnarfer = privmsgs.urlSnarfer(titleSnarfer)
def _updateTinyDb(self, url, tinyurl, channel):

View File

@ -124,7 +124,7 @@ def StrType(s):
def NoSpacesStrType(s):
try:
s = StrType(s)
if len(s.split(), 1) > 1:
if len(s.split(None, 1)) > 1:
raise Error
return s
except Error:
@ -154,16 +154,18 @@ def IntType(s):
try:
return int(s)
except ValueError:
raise Error, 'Value must be an int.'
raise Error, 'Value must be an integer.'
def PositiveIntType(s):
try:
i = IntType(s)
if i <= 0:
if i > 0:
return i
else:
raise Error
return i
except Error:
raise Error, 'Value must be a positive, non-zero integer.'
raise Error, 'Value must be a positive integer.'
class Mixin(object):
"""A mixin class to provide a "config" command that can be consistent