#!/usr/bin/env python3.1 from configparser import ConfigParser, NoSectionError, NoOptionError 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