]> jfr.im git - erebus.git/commitdiff
Fixed bot.send() to work with unicode.
authorJohn Runyon <redacted>
Sun, 26 Jan 2014 17:00:58 +0000 (11:00 -0600)
committerJohn Runyon <redacted>
Sun, 26 Jan 2014 17:00:58 +0000 (11:00 -0600)
Also misc. cleanup to modules

COPYING [new file with mode: 0644]
bot.py
erebus.py
modules/eval.py
modules/foo.py
modules/spotify.py
run.sh
sitecustomize.py [new file with mode: 0644]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..ae2d6d3
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2014, John Runyon and Conny Sjoblom
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/bot.py b/bot.py
index 7a4cb378583eff9344dc464bc7b767e8fd8fdae9..2a4dd14e14c2cc5d0225d0d4e551baf0fbb55315 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: latin-1 -*-
 
 # Erebus IRC bot - Author: John Runyon
 # "Bot" and "BotConnection" classes (handling a specific "arm")
@@ -180,7 +181,7 @@ class BotConnection(object):
 
        #TODO: rewrite send() to queue
        def send(self, line):
-               print self.parent.nick, '[O]', line
+               print self.parent.nick, '[O]', str(line)
                self.write(line)
 
        def write(self, line):
index 38e865dd6429727590a989cf3d9deb4bbc50a716..ebd24f6a88daf474b26ae9226825733ca17b23c6 100644 (file)
--- a/erebus.py
+++ b/erebus.py
@@ -1,4 +1,5 @@
 #!/usr/bin/python
+# -*- coding: latin-1 -*-
 
 # Erebus IRC bot - Author: John Runyon
 # main startup code
index 159635fb3f99eb248c4f43eff1330af424e455ed..6e192829a43deacddf955595d7d4b083adc6119a 100644 (file)
@@ -18,7 +18,6 @@ modstop = lib.modstop
 # module code
 import sys
 
-
 @lib.hook('eval', needchan=False, glevel=lib.MANAGER)
 @lib.argsGE(1)
 def cmd_eval(bot, user, chan, realtarget, *args):
index f5a69fe0760a4ddc612daa3212d6c84e51252893..f2f96d238f735b3607ef7fef508f640493ad2a97 100644 (file)
@@ -17,8 +17,6 @@ modstart = lib.modstart
 modstop = lib.modstop
 
 # module code
-import ctlmod
-
 @lib.hook('test')
 def cmd_test(bot, user, chan, realtarget, *args):
        bot.msg(chan, "You said: !test %s" % (' '.join([str(arg) for arg in args])))
index 7325cefebd657802689ab36073a1ab0be6919b10..fe4e0377a05f3ac9cd5b8ad9b9ae6ed25058dd33 100644 (file)
@@ -1,10 +1,10 @@
-# Erebus IRC bot - Author: John Runyon
+# Erebus IRC bot - Author: Conny Sjoblom
 # Spotify URL Checker
 # This file is released into the public domain; see http://unlicense.org/
 
 # module info
 modinfo = {
-       'author': 'Conny Sjoblom (BiohZn)',
+       'author': 'Conny Sjoblom',
        'license': 'public domain',
        'compatible': [1], # compatible module API versions
        'depends': [], # other modules required to work properly?
@@ -18,7 +18,6 @@ modstop = lib.modstop
 
 # module code
 import re
-import ctlmod
 import urllib2
 from BeautifulSoup import BeautifulSoup
 
diff --git a/run.sh b/run.sh
index b3e885e1e1e967a1a11c753426d18fc3e14709e3..aa7203e2a29ea16efbb0acd153f2cf94083a07c6 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -3,4 +3,5 @@
 # Erebus IRC bot - Author: John Runyon
 # Startup script
 
-python -B "$(dirname $(readlink -f $0))/erebus.py"
+cd "$(dirname $(readlink -f $0))"
+PYTHONPATH=".:$PYTHONPATH" python -B erebus.py
diff --git a/sitecustomize.py b/sitecustomize.py
new file mode 100644 (file)
index 0000000..2417d4d
--- /dev/null
@@ -0,0 +1,2 @@
+import sys
+sys.setdefaultencoding('utf-8')