dr.botzo.py: whitespace/string cleanups

shockingly minor, it's a small file but i was expecting more egregious
code than there actually was
This commit is contained in:
Brian S. Stephan 2012-12-18 23:40:54 -06:00
parent bf6a5c5352
commit 1ec2747f3e
1 changed files with 11 additions and 5 deletions

View File

@ -14,6 +14,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
@ -45,9 +46,11 @@ try:
botuser = config.get('dr.botzo', 'user')
botircname = config.get('dr.botzo', 'name')
except NoSectionError as e:
sys.exit("Aborted due to error with necessary configuration: " + str(e))
sys.exit("Aborted due to error with necessary configuration: "
"{0:s}".format(str(e)))
except NoOptionError as e:
sys.exit("Aborted due to error with necessary configuration: " + str(e))
sys.exit("Aborted due to error with necessary configuration: "
"{0:s}".format(str(e)))
logging.config.fileConfig('logging.cfg')
log = logging.getLogger('drbotzo')
@ -79,13 +82,15 @@ try:
db.commit()
finally: cur.close()
except NoOptionError as e:
sys.exit("Aborted due to error with necessary configuration: " + str(e))
sys.exit("Aborted due to error with necessary configuration: "
"{0:s}".format(str(e)))
# start up the IRC bot
# create IRC and server objects and connect
irc = DrBotIRC.DrBotIRC(config)
server = irc.server().connect(botserver, botport, botnick, botpass, botuser, botircname)
server = irc.server().connect(botserver, botport, botnick, botpass,
botuser, botircname)
# load features
try:
@ -95,7 +100,8 @@ try:
for mod in mods:
irc.load_module(mod)
except NoOptionError as e:
log.warning("You seem to be missing a module_list config option, which you probably wanted.")
log.warning("You seem to be missing a module_list config option, which "
"you probably wanted.")
# loop forever
irc.process_forever()