diff --git a/dr.botzo.py b/dr.botzo.py
index 164e0e6..eddc527 100644
--- a/dr.botzo.py
+++ b/dr.botzo.py
@@ -25,7 +25,6 @@ import sys
import MySQLdb as mdb
import DrBotIRC
-from extlib import irclib
config_file = 'dr.botzo.cfg'
# check argv
diff --git a/modules/Babelfish.py b/modules/Babelfish.py
index d09a701..66b36a4 100644
--- a/modules/Babelfish.py
+++ b/modules/Babelfish.py
@@ -20,8 +20,6 @@ import re
import urllib2
from urllib import urlencode
-from extlib import irclib
-
from Module import Module
class Babelfish(Module):
diff --git a/modules/Countdown.py b/modules/Countdown.py
index 876bd61..bfd0718 100644
--- a/modules/Countdown.py
+++ b/modules/Countdown.py
@@ -23,7 +23,6 @@ import re
from dateutil.parser import *
from dateutil.relativedelta import *
from dateutil.tz import *
-from extlib import irclib
from Module import Module
diff --git a/modules/Dice.py b/modules/Dice.py
index 3c8e4cd..573c85b 100644
--- a/modules/Dice.py
+++ b/modules/Dice.py
@@ -20,13 +20,11 @@ import math
import re
import random
-from extlib import irclib
-
-from Module import Module
-
import ply.lex as lex
import ply.yacc as yacc
+from Module import Module
+
class Dice(Module):
"""Roll simple or complex dice strings."""
@@ -307,7 +305,6 @@ class Dice(Module):
matches = regex.search(roll)
if matches is not None:
dice = int(matches.group(1))
- comment = ''
modifier = 0
if matches.group(2) is not None and matches.group(3) is not None:
@@ -316,9 +313,6 @@ class Dice(Module):
else:
modifier = int(matches.group(3))
- if matches.group(4) is not None:
- comment = matches.group(4)
-
result = roll + ': '
rolls = []
diff --git a/modules/Echo.py b/modules/Echo.py
index f21ceff..925e1ca 100644
--- a/modules/Echo.py
+++ b/modules/Echo.py
@@ -18,8 +18,6 @@ along with this program. If not, see .
import re
-from extlib import irclib
-
from Module import Module
class Echo(Module):
diff --git a/modules/EightBall.py b/modules/EightBall.py
index 2cc3cfc..d4eba5d 100644
--- a/modules/EightBall.py
+++ b/modules/EightBall.py
@@ -19,8 +19,6 @@ along with this program. If not, see .
import random
import re
-from extlib import irclib
-
from Module import Module
class EightBall(Module):
diff --git a/modules/Facts.py b/modules/Facts.py
index fbe7e13..d20986f 100644
--- a/modules/Facts.py
+++ b/modules/Facts.py
@@ -21,8 +21,6 @@ import re
import MySQLdb as mdb
-from extlib import irclib
-
from Module import Module
class Facts(Module):
@@ -129,7 +127,7 @@ class Facts(Module):
except mdb.Error as e:
self.log.error("database error in _get_fact")
self.log.exception(e)
- return self.reply(connection, event, "database error in _get_fact")
+ raise
finally: cur.close()
# vi:tabstop=4:expandtab:autoindent
diff --git a/modules/GoogleTranslate.py b/modules/GoogleTranslate.py
index 9e4f0c1..33dbbb8 100644
--- a/modules/GoogleTranslate.py
+++ b/modules/GoogleTranslate.py
@@ -20,8 +20,6 @@ import re
from urllib2 import urlopen
from urllib import urlencode
-from extlib import irclib
-
from Module import Module
class GoogleTranslate(Module):
diff --git a/modules/IrcAdmin.py b/modules/IrcAdmin.py
index f98bddc..459b746 100644
--- a/modules/IrcAdmin.py
+++ b/modules/IrcAdmin.py
@@ -17,8 +17,6 @@ along with this program. If not, see .
"""
from ConfigParser import NoOptionError
-import signal
-import sys
from extlib import irclib
diff --git a/modules/Karma.py b/modules/Karma.py
index 78c4dd8..03f3bb5 100644
--- a/modules/Karma.py
+++ b/modules/Karma.py
@@ -18,7 +18,6 @@ along with this program. If not, see .
from math import floor
import re
-import string
import MySQLdb as mdb
diff --git a/modules/Markov.py b/modules/Markov.py
index 471aada..ae04eb7 100644
--- a/modules/Markov.py
+++ b/modules/Markov.py
@@ -16,19 +16,15 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
"""
-import cPickle
from datetime import datetime
-import os
import random
import re
-import sys
import thread
import time
+from dateutil.relativedelta import *
import MySQLdb as mdb
-from dateutil.parser import *
-from dateutil.relativedelta import *
from extlib import irclib
from Module import Module
@@ -453,7 +449,6 @@ class Markov(Module):
def _get_chatter_targets(self):
"""Get all possible chatter targets."""
- values = []
db = self.get_db()
try:
# need to create our own db object, since this is likely going to be in a new thread
diff --git a/modules/Pi.py b/modules/Pi.py
index d10c843..e343d12 100644
--- a/modules/Pi.py
+++ b/modules/Pi.py
@@ -22,8 +22,6 @@ import re
import MySQLdb as mdb
-from extlib import irclib
-
from Module import Module
class Pi(Module):
diff --git a/modules/Seen.py b/modules/Seen.py
index f1f0f5c..863a9e5 100644
--- a/modules/Seen.py
+++ b/modules/Seen.py
@@ -18,11 +18,8 @@ along with this program. If not, see .
import re
-import MySQLdb as mdb
-
-from datetime import datetime
from dateutil.tz import *
-from extlib import irclib
+import MySQLdb as mdb
from Module import Module
diff --git a/modules/Storycraft.py b/modules/Storycraft.py
index 5535b2f..cf9d474 100644
--- a/modules/Storycraft.py
+++ b/modules/Storycraft.py
@@ -20,7 +20,6 @@ import random
import re
import time
-from datetime import datetime
from dateutil.tz import *
import MySQLdb as mdb
@@ -1141,7 +1140,6 @@ class Storycraft(Module):
f.write(line.line + '\n')
- legend = ''
f.write('\n')
for player in lines_by_player.keys():
f.write(player + ':' + ','.join(lines_by_player[player]) + '\n')
diff --git a/modules/TextTransform.py b/modules/TextTransform.py
index f816db9..9f0fe16 100644
--- a/modules/TextTransform.py
+++ b/modules/TextTransform.py
@@ -19,8 +19,6 @@ along with this program. If not, see .
import base64
import re
-from extlib import irclib
-
from Module import Module
class TextTransform(Module):
diff --git a/modules/Twitter.py b/modules/Twitter.py
index 4a14d0b..e752203 100644
--- a/modules/Twitter.py
+++ b/modules/Twitter.py
@@ -16,7 +16,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
"""
-from ConfigParser import NoSectionError, NoOptionError
import oauth2 as oauth
import re
import thread
@@ -25,7 +24,6 @@ import urlparse
import MySQLdb as mdb
-from extlib import irclib
from extlib import twitter
from Module import Module
@@ -298,7 +296,7 @@ class Twitter(Module):
try:
return self.twit.VerifyCredentials()
- except Exception as e:
+ except Exception:
return None
def _log_in_to_twitter(self, oauth_token, oauth_token_secret):
diff --git a/modules/Weather.py b/modules/Weather.py
index a27c417..8e3903d 100644
--- a/modules/Weather.py
+++ b/modules/Weather.py
@@ -19,7 +19,6 @@ along with this program. If not, see .
import re
-from extlib import irclib
from extlib import pywapi
from urllib import quote