mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fixed some bugz0rs.
This commit is contained in:
parent
a58e5b97d9
commit
8b6733ee5d
@ -217,7 +217,7 @@ class URL(callbacks.PrivmsgCommandAndRegexp,
|
|||||||
s = 'Title: %s' % utils.htmlToText(m.group(1).strip())
|
s = 'Title: %s' % utils.htmlToText(m.group(1).strip())
|
||||||
if self.configurables.get('titlesnarferincludesurl', channel):
|
if self.configurables.get('titlesnarferincludesurl', channel):
|
||||||
s += ' (<%s>)' % url
|
s += ' (<%s>)' % url
|
||||||
irc.reply(msg, 'Title: %s' % s, prefixName=False)
|
irc.reply(msg, s, prefixName=False)
|
||||||
titleSnarfer = privmsgs.urlSnarfer(titleSnarfer)
|
titleSnarfer = privmsgs.urlSnarfer(titleSnarfer)
|
||||||
|
|
||||||
def _updateTinyDb(self, url, tinyurl, channel):
|
def _updateTinyDb(self, url, tinyurl, channel):
|
||||||
|
@ -124,7 +124,7 @@ def StrType(s):
|
|||||||
def NoSpacesStrType(s):
|
def NoSpacesStrType(s):
|
||||||
try:
|
try:
|
||||||
s = StrType(s)
|
s = StrType(s)
|
||||||
if len(s.split(), 1) > 1:
|
if len(s.split(None, 1)) > 1:
|
||||||
raise Error
|
raise Error
|
||||||
return s
|
return s
|
||||||
except Error:
|
except Error:
|
||||||
@ -154,16 +154,18 @@ def IntType(s):
|
|||||||
try:
|
try:
|
||||||
return int(s)
|
return int(s)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise Error, 'Value must be an int.'
|
raise Error, 'Value must be an integer.'
|
||||||
|
|
||||||
def PositiveIntType(s):
|
def PositiveIntType(s):
|
||||||
try:
|
try:
|
||||||
i = IntType(s)
|
i = IntType(s)
|
||||||
if i <= 0:
|
if i > 0:
|
||||||
|
return i
|
||||||
|
else:
|
||||||
raise Error
|
raise Error
|
||||||
return i
|
|
||||||
except Error:
|
except Error:
|
||||||
raise Error, 'Value must be a positive, non-zero integer.'
|
raise Error, 'Value must be a positive integer.'
|
||||||
|
|
||||||
|
|
||||||
class Mixin(object):
|
class Mixin(object):
|
||||||
"""A mixin class to provide a "config" command that can be consistent
|
"""A mixin class to provide a "config" command that can be consistent
|
||||||
|
Loading…
Reference in New Issue
Block a user