diff --git a/Makefile b/Makefile index bec372a..0185418 100644 --- a/Makefile +++ b/Makefile @@ -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 old mode 100644 new mode 100755 diff --git a/icao.py b/icao.py old mode 100644 new mode 100755 diff --git a/modules/__init__.py b/modules/__init__.py old mode 100644 new mode 100755 diff --git a/modules/admin.py b/modules/admin.py old mode 100644 new mode 100755 diff --git a/modules/calc.py b/modules/calc.py old mode 100644 new mode 100755 diff --git a/modules/codepoints.py b/modules/codepoints.py old mode 100644 new mode 100755 index d966670..f2eb862 --- 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 old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 diff --git a/modules/translate.py b/modules/translate.py old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 696bce4..cb9cf6b --- 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 old mode 100644 new mode 100755 diff --git a/opt/freenode.py b/opt/freenode.py old mode 100644 new mode 100755 diff --git a/opt/swhack.py b/opt/swhack.py old mode 100644 new mode 100755 diff --git a/tools.py b/tools.py old mode 100644 new mode 100755