Some sundry fixes and improvements to the modules.

master
Sean B. Palmer 2008-03-01 21:07:23 +00:00
parent 3d920f4317
commit 1078791cb6
17 changed files with 9 additions and 5 deletions

View File

@ -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

0
__init__.py Normal file → Executable file
View File

0
icao.py Normal file → Executable file
View File

0
modules/__init__.py Normal file → Executable file
View File

0
modules/admin.py Normal file → Executable file
View File

0
modules/calc.py Normal file → Executable file
View File

5
modules/codepoints.py Normal file → Executable file
View File

@ -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)'

0
modules/info.py Normal file → Executable file
View File

View File

@ -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')

0
modules/startup.py Normal file → Executable file
View File

0
modules/translate.py Normal file → Executable file
View File

View File

@ -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/'

3
modules/wikipedia.py Normal file → Executable file
View File

@ -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

0
opt/__init__.py Normal file → Executable file
View File

0
opt/freenode.py Normal file → Executable file
View File

0
opt/swhack.py Normal file → Executable file
View File

0
tools.py Normal file → Executable file
View File