Just keep fixing
This commit is contained in:
parent
74af0c989f
commit
80ecfbfa19
|
@ -241,7 +241,7 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
|
|
||||||
def bugSnarfer(self, irc, msg, match):
|
def bugSnarfer(self, irc, msg, match):
|
||||||
r"""\b(?P<bt>(([a-z]+)?\s+bugs?|[a-z]+))\s+#?(?P<bug>\d+(?!\d*\.\d+)((,|\s*(and|en|et|und|ir))\s*#?\d+(?!\d*\.\d+))*)"""
|
r"""\b(?P<bt>(([a-z]+)?\s+bugs?|[a-z]+))\s+#?(?P<bug>\d+(?!\d*\.\d+)((,|\s*(and|en|et|und|ir))\s*#?\d+(?!\d*\.\d+))*)"""
|
||||||
if not self.registryValue('bugSnarfer', msg.args[0]):
|
if msg.args[0][0] == '#' and not self.registryValue('bugSnarfer', msg.args[0]):
|
||||||
return
|
return
|
||||||
# Don't double on commands
|
# Don't double on commands
|
||||||
s = str(msg).split(':')[2]
|
s = str(msg).split(':')[2]
|
||||||
|
@ -309,7 +309,7 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
#&group_id=\d+&at_id=\d+
|
#&group_id=\d+&at_id=\d+
|
||||||
def turlSnarfer(self, irc, msg, match):
|
def turlSnarfer(self, irc, msg, match):
|
||||||
"(?P<tracker>https?://.*?)(show_bug.cgi\?id=|bugreport.cgi\?bug=|(bugs|\+bug)/|/ticket/|tracker/.*aid=)(?P<bug>\d+)(?P<sfurl>&group_id=\d+&at_id=\d+)?"
|
"(?P<tracker>https?://.*?)(show_bug.cgi\?id=|bugreport.cgi\?bug=|(bugs|\+bug)/|/ticket/|tracker/.*aid=)(?P<bug>\d+)(?P<sfurl>&group_id=\d+&at_id=\d+)?"
|
||||||
if not self.registryValue('bugSnarfer', msg.args[0]):
|
if msg.args[0][0] == '#' and not self.registryValue('bugSnarfer', msg.args[0]):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
tracker = self.get_tracker(match.group(0),match.group('sfurl'))
|
tracker = self.get_tracker(match.group(0),match.group('sfurl'))
|
||||||
|
|
|
@ -270,7 +270,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
f.name += '-%s' % newchannel
|
f.name += '-%s' % newchannel
|
||||||
f.value = '<alias> ' + aliases.channel_primary.name
|
f.value = '<alias> ' + aliases.channel_primary.name
|
||||||
else:
|
else:
|
||||||
irc.error("Unresolvable alias:")
|
irc.error("Unresolvable alias: %s" % alias)
|
||||||
return
|
return
|
||||||
# Finally, save
|
# Finally, save
|
||||||
cur.execute("UPDATE facts SET value = %s WHERE name = %s", (f.value, f.name))
|
cur.execute("UPDATE facts SET value = %s WHERE name = %s", (f.value, f.name))
|
||||||
|
@ -284,11 +284,15 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
if '>' in text:
|
if '>' in text:
|
||||||
_target = text[text.rfind('>')+1:].strip()
|
_target = text[text.rfind('>')+1:].strip()
|
||||||
text = text[:text.rfind('>')].strip()
|
text = text[:text.rfind('>')].strip()
|
||||||
if text.startswith('tell ') and ' about ' in text:
|
if text.startswith('tell '):
|
||||||
_target = text[5:].strip().split(None,1)[0]
|
text = ' ' + text
|
||||||
|
if ' tell ' in text and ' about ' in text:
|
||||||
|
_target = text[text.find(' tell ')+6:].strip().split(None,1)[0]
|
||||||
text = text[text.find(' about ')+7:].strip()
|
text = text[text.find(' about ')+7:].strip()
|
||||||
if _target:
|
if _target:
|
||||||
# Validate
|
# Validate
|
||||||
|
if _target == 'me':
|
||||||
|
target = msg.nick
|
||||||
for chan in irc.state.channels:
|
for chan in irc.state.channels:
|
||||||
if _target in irc.state.channels[chan].users and msg.nick in irc.state.channels[chan].users:
|
if _target in irc.state.channels[chan].users and msg.nick in irc.state.channels[chan].users:
|
||||||
target = _target
|
target = _target
|
||||||
|
|
Loading…
Reference in New Issue