dr.botzo/dr.botzo.py

23 lines
697 B
Python
Raw Normal View History

#!/usr/bin/env python2.6
2010-07-24 09:54:38 -05:00
from ConfigParser import ConfigParser, NoSectionError, NoOptionError
2010-07-24 09:54:38 -05:00
import os
import sys
2010-07-24 09:54:38 -05:00
config = ConfigParser()
2010-07-24 09:54:38 -05:00
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))
2010-07-24 09:54:38 -05:00
# vi:tabstop=4:expandtab:autoindent