From 26d2e0c294443590b2aa777c7f5b6e8603eccc53 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 29 Jul 2010 00:18:20 -0500 Subject: [PATCH] making imports fit my style convention, actually importing os in the module that needs it --- Module.py | 3 ++- modules/Countdown.py | 6 ++++-- modules/Dice.py | 6 ++++-- modules/FactFile.py | 7 +++++-- modules/GoogleTranslate.py | 6 ++++-- modules/IrcAdmin.py | 6 +++--- modules/Seen.py | 6 ++++-- 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Module.py b/Module.py index 54f3bd1..d01859d 100644 --- a/Module.py +++ b/Module.py @@ -14,9 +14,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from irclib import irclib import re +from irclib import irclib + # Base class used for creating classes that have real functionality. class Module(object): diff --git a/modules/Countdown.py b/modules/Countdown.py index b50bb25..02ac468 100644 --- a/modules/Countdown.py +++ b/modules/Countdown.py @@ -14,10 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from Module import Module -from irclib import irclib from ConfigParser import NoOptionError +from irclib import irclib + +from Module import Module + # Class that adds a countdown item to the bot class Countdown(Module): diff --git a/modules/Dice.py b/modules/Dice.py index 4682a2b..b872987 100644 --- a/modules/Dice.py +++ b/modules/Dice.py @@ -14,11 +14,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from Module import Module -from irclib import irclib import re import random +from irclib import irclib + +from Module import Module + # Rolls dice, for RPGs mostly class Dice(Module): diff --git a/modules/FactFile.py b/modules/FactFile.py index 535a6f4..a53b2b4 100644 --- a/modules/FactFile.py +++ b/modules/FactFile.py @@ -14,9 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from Module import Module -from irclib import irclib from ConfigParser import NoOptionError +import os + +from irclib import irclib + +from Module import Module # Returns a random fact/quote/whatever from one or more files diff --git a/modules/GoogleTranslate.py b/modules/GoogleTranslate.py index 56a6fae..64c6834 100644 --- a/modules/GoogleTranslate.py +++ b/modules/GoogleTranslate.py @@ -14,11 +14,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from Module import Module -from irclib import irclib from urllib2 import urlopen from urllib import urlencode +from irclib import irclib + +from Module import Module + # Class that translates text via Google Translate. # # http://code.google.com/apis/ajaxlanguage/documentation/ diff --git a/modules/IrcAdmin.py b/modules/IrcAdmin.py index 00fc578..b457a45 100644 --- a/modules/IrcAdmin.py +++ b/modules/IrcAdmin.py @@ -15,9 +15,10 @@ # along with this program. If not, see . from ConfigParser import NoOptionError -from Module import Module + from irclib import irclib -import traceback + +from Module import Module # All kinds of miscellaneous irc stuff @@ -67,7 +68,6 @@ class IrcAdmin(Module): if whats[0] == 'rehash' and admin_unlocked: self.rehash() replystr = 'rehashed modules' - #traceback.print_stack() if replypath is None: return replystr else: diff --git a/modules/Seen.py b/modules/Seen.py index 3381d5f..69d11cf 100644 --- a/modules/Seen.py +++ b/modules/Seen.py @@ -14,12 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from Module import Module -from irclib import irclib from ConfigParser import NoOptionError + +from irclib import irclib from datetime import datetime from dateutil.tz import * +from Module import Module + # Keeps track of when people say things in public channels, and reports on when # they last said something.