Some sundry fixes and improvements to the modules.
parent
3d920f4317
commit
1078791cb6
|
@ -12,7 +12,10 @@ from itertools import islice
|
||||||
|
|
||||||
def about(u, cp=None, name=None):
|
def about(u, cp=None, name=None):
|
||||||
if cp is None: cp = ord(u)
|
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):
|
if not unicodedata.combining(u):
|
||||||
template = 'U+%04X %s (%s)'
|
template = 'U+%04X %s (%s)'
|
||||||
|
|
|
@ -14,7 +14,7 @@ def f_reload(phenny, input):
|
||||||
if not input.admin: return
|
if not input.admin: return
|
||||||
|
|
||||||
name = input.group(2)
|
name = input.group(2)
|
||||||
if not name:
|
if (not name) or (name == '*'):
|
||||||
phenny.setup()
|
phenny.setup()
|
||||||
return phenny.reply('done')
|
return phenny.reply('done')
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ def val(phenny, input):
|
||||||
else: result += ' (%s error)' % n
|
else: result += ' (%s error)' % n
|
||||||
else: result += 'Unvalidatable: no X-W3C-Validator-Status'
|
else: result += 'Unvalidatable: no X-W3C-Validator-Status'
|
||||||
|
|
||||||
phenny.say(' ' + result)
|
phenny.reply(result)
|
||||||
val.rule = (['val'], r'(?i)(\S+)')
|
val.rule = (['val'], r'(?i)(\S+)')
|
||||||
val.example = '.val http://www.w3.org/'
|
val.example = '.val http://www.w3.org/'
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,8 @@ def search(term):
|
||||||
return term
|
return term
|
||||||
|
|
||||||
term = term.replace('_', ' ')
|
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:
|
if uri:
|
||||||
return uri[len('http://en.wikipedia.org/wiki/'):]
|
return uri[len('http://en.wikipedia.org/wiki/'):]
|
||||||
else: return term
|
else: return term
|
||||||
|
|
Loading…
Reference in New Issue