]> jfr.im git - erebus.git/commitdiff
update encoding
authorzonidjan <redacted>
Mon, 30 Jul 2018 17:24:13 +0000 (12:24 -0500)
committerzonidjan <redacted>
Mon, 30 Jul 2018 17:24:13 +0000 (12:24 -0500)
21 files changed:
bot.py
config.py
ctlmod.py
erebus.py
modlib.py
modules/chanops.py
modules/coins.py
modules/control.py
modules/eval.py
modules/foo.py
modules/help.py
modules/msg.py
modules/resources.py
modules/sms.py
modules/stafflist.py
modules/subtext.py
modules/trivia.py
modules/urls.py
modules/userinfo.py
modules/weather.py
sitecustomize.py

diff --git a/bot.py b/bot.py
index e86fdbd5f13fcc4fb4b5a0c2677576cc0b57ecff..610c6cda694cd7d8d9eaae0ed4c3ff080240ceb1 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# vim: fileencoding=utf-8
 
 # Erebus IRC bot - Author: John Runyon
 # "Bot" and "BotConnection" classes (handling a specific "arm")
index 0d4106c7e0b51d0897074e56e83ad12be742d2e5..e0c604748948656b1d6a75e7efbcbbdf8a60af64 100644 (file)
--- a/config.py
+++ b/config.py
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: John Runyon
+# vim: fileencoding=utf-8
 # "Config" class (reading/providing access to bot.config)
 
 from __future__ import print_function
index 09ce8fa51022b66d024306f2602ae68d458efdf0..2799f01ec4f2ecef21d4c98cb86a002a8d863be3 100644 (file)
--- a/ctlmod.py
+++ b/ctlmod.py
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: John Runyon
+# vim: fileencoding=utf-8
 # module loading/unloading/tracking code
 
 from __future__ import print_function
index cafd918f16bcd2222d1c24e3dae2b752e010c835..ae8390f94440e946c0e8afbf63180a06b59c5b08 100644 (file)
--- a/erebus.py
+++ b/erebus.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# vim: fileencoding=utf-8
 
 # Erebus IRC bot - Author: John Runyon
 # main startup code
index e5c8d81bc2964e0648bbf71e5f9f64c230883909..e711086a281b42fe90bc408873d982863b4242f3 100644 (file)
--- a/modlib.py
+++ b/modlib.py
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: John Runyon
+# vim: fileencoding=utf-8
 # module helper functions, see modules/modtest.py for usage
 # This file is released into the public domain; see http://unlicense.org/
 
index 654c45ce8cd00aa05a81643113b3521055faea12..e2c1403f9baccdbb723d771077fc9a1c69be9d14 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # chanop commands
 # This file is released into the public domain; see http://unlicense.org/
 
index 4603366ce3e06153eafcb7795d025489b836e199..8653667f0f95ce02a4802e79ec7ec387fad50290 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # simple coin module
 # This file is released into the public domain; see http://unlicense.org/
 
index 85160c14a72e9e68d92946c89b79f8f977e60e5f..a1ee13872fd57a39440a5cb7d5b2816397c2e84d 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # Various highly recommended "control" commands.
 # This file is released into the public domain; see http://unlicense.org/
 
index e6fad75291396ead61bd498aa53332bd25e58613..00f37ebd71e592fbe07faf4f35bd7ded5a2b8ed9 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # !EVAL and !EXEC commands
 # This file is released into the public domain; see http://unlicense.org/
 
index ea91a9f77285df703043f01334ab83a3c058a8de..f6e430cff0db33b81f2931d45b03a3240721ed32 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # simple module example
 # This file is released into the public domain; see http://unlicense.org/
 
index bb5c94b4a7ade109e4077b90634abb139848e72c..8e13a2b6241289811a56e2f547e067c62db08c2a 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # help module
 # This file is released into the public domain; see http://unlicense.org/
 
index 6f6b95ce85858422479cd714aeb7c637aff3d57c..d67382ba6101721e6bc26a6a5bb5ceb3ba49e87f 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # This file is released into the public domain; see http://unlicense.org/
 
 # module info
index e5b7de1b02d063a5497cf197aca4412816a84bb3..606bdc76726d60cea3ea1b91512df3642c0ea6dc 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # resource-usage module
 # This file is released into the public domain; see http://unlicense.org/
 
index 84b4c0e71ccaa9198651a93c440254322a8c088b..12e5b21744558f3aff743b6e871eed8caf3e2f6c 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # twilio sms module
 # This file is released into the public domain; see http://unlicense.org/
 
index 0abcefd27f30a1e574c7e6080e50cff62da7d8b8..6449718ded763359a8b114060d3e10b1472809fa 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # staff list module
 # This file is released into the public domain; see http://unlicense.org/
 
index ca0ab0475154cd32793a9487b66b29f80a77d4b3..329005093cedbb03b4ff8b6425113db4b5049a4a 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # module for 's/regex/replacement/' style correction
 # see for usage examples: https://github.com/zonidjan/erebus/commit/d7e9802778477f1faa26a03078cb1b3c018a5e5c
 # This file is released into the public domain; see http://unlicense.org/
index 8b278f369ad0280bf4b9b2d53c736e0d9d719d38..3e79db35ed96434d3b4da8a0a941d3be28b5da5b 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # trivia module
 # This file is released into the public domain; see http://unlicense.org/
 
index e25777873835da3f7b051cdbc6143444fb3ce478..0430a638e13a85c8aa9f8eb795417f4deadc85e6 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # URL Checker
 # This file is released into the public domain; see http://unlicense.org/
 
index 15abad10ab76ad4c07e36cfcbcdb60435c703842..fd706f1dc73b85c63b43f0a44d53b3ef37ae1336 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # userinfo module
 # This file is released into the public domain; see http://unlicense.org/
 
index fc9e300b8ae983c3ed4f625ea05bf758a8e902a3..2ec27be714cd879de5fde8169a500909910a0eda 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # weather module
 # This file is released into the public domain; see http://unlicense.org/
 
@@ -33,7 +34,7 @@ def _dayofweek(dayname):
 
 def _weather(place):
        if place is not None:
-               weather = json.load(urlopen('http://api.wunderground.com/api/8670e6d2e69ff3c7/conditions/q/%s.json' % (place)))
+               weather = json.load(urlopen(('http://api.wunderground.com/api/8670e6d2e69ff3c7/conditions/q/%s.json' % (place)).encode('utf8')))
                if lib.parent.cfg.getboolean('debug', 'weather'):
                        lib.parent.log('*', "?", repr(weather))
                if 'response' in weather:
@@ -52,7 +53,7 @@ def _weather(place):
                        measuredatTZ = '(actual time unknown)'
                loc = current['observation_location']
                if loc['city'] == "" or loc['state'] == "": loc = current['display_location']
-               return u"Weather in %(location)s: As of %(time)s %(tz)s, %(conditions)s, %(cel)s\u00B0C (%(far)s\u00B0F) (feels like %(flcel)s\u00B0C (%(flfar)s\u00B0F)). Wind %(wind)s. %(link)s" % {
+               return u"Weather in %(location)s: As of %(time)s %(tz)s, %(conditions)s, %(cel)s°C (%(far)s°F) (feels like %(flcel)s°C (%(flfar)s°F)). Wind %(wind)s. %(link)s" % {
                        'location': loc['full'],
                        'time': time.strftime("%a %H:%M", tuple(measuredat)), # now we have to turn it back into a tuple because Py3's time.strftime requires it.
                        'tz': measuredatTZ,
@@ -78,5 +79,6 @@ def weather(bot, user, chan, realtarget, *args):
 
 @lib.hook(('weatheruser','wu'))
 @lib.help('<user>', 'show weather for <user>\'s location')
+@lib.argsEQ(1)
 def wu(bot, user, chan, realtarget, *args):
        bot.msg(chan, _weather(location(' '.join(args))))
index c70d4fa486b29444a5fdc405faad47cbbc006c09..9e9c098cf3191089db9b53be6b7bbf206bd32b53 100644 (file)
@@ -1,3 +1,4 @@
+# vim: fileencoding=utf-8
 import sys
 if sys.version_info.major < 3:
        sys.setdefaultencoding('utf-8')