diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-03-01 21:07:23 +0000 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-03-01 21:07:23 +0000 |
commit | 1078791cb60d3ce4543d579fc07b9c0c145e8d10 (patch) | |
tree | a4169992239556f33b8154cb35a676c3bd8e8620 | |
parent | 3d920f431789ac53596933785b5fe61463335e3b (diff) | |
download | bot-1078791cb60d3ce4543d579fc07b9c0c145e8d10.tar.gz bot-1078791cb60d3ce4543d579fc07b9c0c145e8d10.tar.bz2 bot-1078791cb60d3ce4543d579fc07b9c0c145e8d10.zip |
Some sundry fixes and improvements to the modules.
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | __init__.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | icao.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/__init__.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/admin.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/calc.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/codepoints.py | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/info.py | 0 | ||||
-rwxr-xr-x | modules/reload.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/startup.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/translate.py | 0 | ||||
-rwxr-xr-x | modules/validate.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | modules/wikipedia.py | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | opt/__init__.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | opt/freenode.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | opt/swhack.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tools.py | 0 |
17 files changed, 9 insertions, 5 deletions
@@ -3,4 +3,4 @@ # Licensed under the Eiffel Forum License 2. archive: ; - hg archive -t tbz2 phenny.tar.bz2 + hg archive -t tbz2 phenny.tar.bz2 diff --git a/__init__.py b/__init__.py index 8137683..8137683 100644..100755 --- a/__init__.py +++ b/__init__.py diff --git a/modules/__init__.py b/modules/__init__.py index e69de29..e69de29 100644..100755 --- a/modules/__init__.py +++ b/modules/__init__.py diff --git a/modules/admin.py b/modules/admin.py index de2a7a7..de2a7a7 100644..100755 --- a/modules/admin.py +++ b/modules/admin.py diff --git a/modules/calc.py b/modules/calc.py index 6768035..6768035 100644..100755 --- a/modules/calc.py +++ b/modules/calc.py diff --git a/modules/codepoints.py b/modules/codepoints.py index d966670..f2eb862 100644..100755 --- a/modules/codepoints.py +++ b/modules/codepoints.py @@ -12,7 +12,10 @@ from itertools import islice def about(u, cp=None, name=None): if cp is None: cp = ord(u) - if name is None: name = unicodedata.name(u) + if name is None: + try: name = unicodedata.name(u) + except ValueError: + return 'U+%04X (No name found)' % cp if not unicodedata.combining(u): template = 'U+%04X %s (%s)' diff --git a/modules/info.py b/modules/info.py index df6ad69..df6ad69 100644..100755 --- a/modules/info.py +++ b/modules/info.py diff --git a/modules/reload.py b/modules/reload.py index 2febcd2..6e65dd2 100755 --- a/modules/reload.py +++ b/modules/reload.py @@ -14,7 +14,7 @@ def f_reload(phenny, input): if not input.admin: return name = input.group(2) - if not name: + if (not name) or (name == '*'): phenny.setup() return phenny.reply('done') diff --git a/modules/startup.py b/modules/startup.py index 1fd7348..1fd7348 100644..100755 --- a/modules/startup.py +++ b/modules/startup.py diff --git a/modules/translate.py b/modules/translate.py index d90de43..d90de43 100644..100755 --- a/modules/translate.py +++ b/modules/translate.py diff --git a/modules/validate.py b/modules/validate.py index 3e179e7..185623f 100755 --- a/modules/validate.py +++ b/modules/validate.py @@ -33,7 +33,7 @@ def val(phenny, input): else: result += ' (%s error)' % n else: result += 'Unvalidatable: no X-W3C-Validator-Status' - phenny.say(' ' + result) + phenny.reply(result) val.rule = (['val'], r'(?i)(\S+)') val.example = '.val http://www.w3.org/' diff --git a/modules/wikipedia.py b/modules/wikipedia.py index 696bce4..cb9cf6b 100644..100755 --- a/modules/wikipedia.py +++ b/modules/wikipedia.py @@ -49,7 +49,8 @@ def search(term): return term term = term.replace('_', ' ') - uri = google.google('site:en.wikipedia.org %s' % term) + try: uri = google.google('site:en.wikipedia.org %s' % term) + except IndexError: return term if uri: return uri[len('http://en.wikipedia.org/wiki/'):] else: return term diff --git a/opt/__init__.py b/opt/__init__.py index e69de29..e69de29 100644..100755 --- a/opt/__init__.py +++ b/opt/__init__.py diff --git a/opt/freenode.py b/opt/freenode.py index f3d285c..f3d285c 100644..100755 --- a/opt/freenode.py +++ b/opt/freenode.py diff --git a/opt/swhack.py b/opt/swhack.py index 60914c0..60914c0 100644..100755 --- a/opt/swhack.py +++ b/opt/swhack.py |