diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c9b568f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.swp diff --git a/dr.botzo.cfg b/dr.botzo.cfg new file mode 100644 index 0000000..87e2c3f --- /dev/null +++ b/dr.botzo.cfg @@ -0,0 +1,6 @@ +[IRC] +server = irc.foonetic.net +port = 6667 +channel = #lh +nick = dr_devzo +name = dr. devzo diff --git a/dr.botzo.py b/dr.botzo.py new file mode 100755 index 0000000..b21d9ff --- /dev/null +++ b/dr.botzo.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3.1 + +from configparser import * +import os +import sys + +config = ConfigParser() +config.read([os.path.expanduser('~/.dr.botzo.cfg'), 'dr.botzo.cfg']) + +try: + # load connection info + server = config.get('IRC', 'server') + port = config.getint('IRC', 'port') + channel = config.get('IRC', 'channel') + nick = config.get('IRC', 'nick') + ircname = config.get('IRC', 'name') +except NoSectionError as e: + sys.exit("Aborted due to error with necessary configuration: " + str(e)) +except NoOptionError as e: + sys.exit("Aborted due to error with necessary configuration: " + str(e)) + +# vi:tabstop=4:expandtab:autoindent