diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-12-28 09:42:48 +0000 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-12-28 09:42:48 +0000 |
commit | f9aff27534df2efe64d50c01864925f6fe4cd746 (patch) | |
tree | be37bc304b69c9f6134672813a7982f7396cfa07 /modules | |
parent | d26fc8d81f88f92eb798e28c49b9990dbc73bc14 (diff) | |
download | bot-f9aff27534df2efe64d50c01864925f6fe4cd746.tar.gz bot-f9aff27534df2efe64d50c01864925f6fe4cd746.tar.bz2 bot-f9aff27534df2efe64d50c01864925f6fe4cd746.zip |
Minor bug fixes.
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/clock.py | 10 | ||||
-rwxr-xr-x | modules/etymology.py | 2 | ||||
-rwxr-xr-x | modules/oblique.py | 8 | ||||
-rwxr-xr-x | modules/wikipedia.py | 2 |
4 files changed, 16 insertions, 6 deletions
diff --git a/modules/clock.py b/modules/clock.py index 59c9eb1..d1983ce 100755 --- a/modules/clock.py +++ b/modules/clock.py @@ -135,7 +135,7 @@ TZ2 = { 'HST': 10, 'IDLE': -12, 'IDLW': 12, - 'IST': -5.5, + # 'IST': -5.5, 'IT': -3.5, 'JST': -9, 'JT': -7, @@ -181,8 +181,14 @@ TZ2 = { 'ZP6': -6 } -TimeZones.update(TZ2) +TZ3 = { + 'AEST': 10, + 'AEDT': 11 +} + +# TimeZones.update(TZ2) # do these have to be negated? TimeZones.update(TZ1) +TimeZones.update(TZ3) @deprecated def f_time(self, origin, match, args): diff --git a/modules/etymology.py b/modules/etymology.py index 430e18e..12da548 100755 --- a/modules/etymology.py +++ b/modules/etymology.py @@ -22,7 +22,7 @@ abbrs = [ 'cf', 'lit', 'etc', 'Ger', 'Du', 'Skt', 'Rus', 'Eng', 'Amer.Eng', 'Sp', 'Fr', 'N', 'E', 'S', 'W', 'L', 'Gen', 'J.C', 'dial', 'Gk', '19c', '18c', '17c', '16c', 'St', 'Capt', 'obs', 'Jan', 'Feb', 'Mar', - 'Apr', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'c' + 'Apr', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'c', 'tr' ] t_sentence = r'^.*?(?<!%s)(?:\.(?= [A-Z0-9]|\Z)|\Z)' r_sentence = re.compile(t_sentence % ')(?<!'.join(abbrs)) diff --git a/modules/oblique.py b/modules/oblique.py index a680b6d..da07d7b 100755 --- a/modules/oblique.py +++ b/modules/oblique.py @@ -53,9 +53,13 @@ def o(phenny, input): else: command, args = text, '' command = command.lower() + if command == 'service': + msg = o.services.get(args, 'No such service!') + return phenny.reply(msg) + if o.services.has_key(command): - template = o.services[command] - template = template.replace('${args}', urllib.quote(args.encode('utf-8'))) + t = o.services[command] + template = t.replace('${args}', urllib.quote(args.encode('utf-8'))) template = template.replace('${nick}', urllib.quote(input.nick)) uri = template.replace('${sender}', urllib.quote(input.sender)) diff --git a/modules/wikipedia.py b/modules/wikipedia.py index 6d9bb11..d4753a1 100755 --- a/modules/wikipedia.py +++ b/modules/wikipedia.py @@ -24,7 +24,7 @@ r_redirect = re.compile( abbrs = ['etc', 'ca', 'cf', 'Co', 'Ltd', 'Inc', 'Mt', 'Mr', 'Mrs', 'Dr', 'Ms', 'Rev', 'Fr', 'St', 'Sgt', 'pron', 'approx', 'lit', - 'syn', 'transl', 'sess', 'fl'] \ + 'syn', 'transl', 'sess', 'fl', 'Op'] \ + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') \ + list('abcdefghijklmnopqrstuvwxyz') t_sentence = r'^.{5,}?(?<!\b%s)(?:\.(?= [A-Z0-9]|\Z)|\Z)' |