summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorSean B. Palmer <http://inamidst.com/sbp/>2009-01-19 16:47:05 +0000
committerSean B. Palmer <http://inamidst.com/sbp/>2009-01-19 16:47:05 +0000
commit2299ef258897a32bfb883e47bcdc5dc212d46758 (patch)
treebe499071e41b7c4c6f1f8ad5cee566db8c2bf8f1 /modules
parentf9aff27534df2efe64d50c01864925f6fe4cd746 (diff)
downloadbot-2299ef258897a32bfb883e47bcdc5dc212d46758.tar.gz
bot-2299ef258897a32bfb883e47bcdc5dc212d46758.tar.bz2
bot-2299ef258897a32bfb883e47bcdc5dc212d46758.zip
Small edits.
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/admin.py6
-rwxr-xr-xmodules/search.py1
-rwxr-xr-xmodules/wikipedia.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/modules/admin.py b/modules/admin.py
index 3c3356f..b617c4c 100755
--- a/modules/admin.py
+++ b/modules/admin.py
@@ -43,9 +43,11 @@ quit.priority = 'low'
def msg(phenny, input):
# Can only be done in privmsg by an admin
if input.sender.startswith('#'): return
+ a, b = input.group(2), input.group(3)
+ if (not a) or (not b): return
if input.admin:
- phenny.msg(input.group(2), input.group(3))
-msg.rule = (['msg'], r'(#?\S+) (.*)')
+ phenny.msg(a, b)
+msg.rule = (['msg'], r'(#?\S+) (.+)')
msg.priority = 'low'
def me(phenny, input):
diff --git a/modules/search.py b/modules/search.py
index 37c7b86..6aa6b2b 100755
--- a/modules/search.py
+++ b/modules/search.py
@@ -19,7 +19,6 @@ def json(text):
if r_json.match(r_string.sub('', text)):
text = r_string.sub(lambda m: 'u' + m.group(1), text)
return eval(text.strip(' \t\r\n'), env, {})
- print text
raise ValueError('Input must be serialised JSON.')
def search(query):
diff --git a/modules/wikipedia.py b/modules/wikipedia.py
index d4753a1..747ad48 100755
--- a/modules/wikipedia.py
+++ b/modules/wikipedia.py
@@ -27,7 +27,7 @@ abbrs = ['etc', 'ca', 'cf', 'Co', 'Ltd', 'Inc', 'Mt', 'Mr', 'Mrs',
'syn', 'transl', 'sess', 'fl', 'Op'] \
+ list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') \
+ list('abcdefghijklmnopqrstuvwxyz')
-t_sentence = r'^.{5,}?(?<!\b%s)(?:\.(?= [A-Z0-9]|\Z)|\Z)'
+t_sentence = r'^.{5,}?(?<!\b%s)(?:\.(?=[\[ ][A-Z0-9]|\Z)|\Z)'
r_sentence = re.compile(t_sentence % r')(?<!\b'.join(abbrs))
def unescape(s):