from ConfigParser import ConfigParser import os cp = ConfigParser() cp.read(["/etc/brathuhn/config.cfg","brathuhn.cfg",os.path.expanduser('~/.brathuhn.cfg')]) NAME = cp.get("Account","NAME") SRV = cp.get("Account","SRV") PWD = cp.get("Account","PWD") try: RESOURCE = cp.get("Account","RESOURCE") except: RESOURCE = 'bot' try: S5B_PROXY = cp.get("General","PROXY") except: S5B_PROXY = 'proxy.jabbim.cz' try: PCACHE = cp.get("General","PROXY") except: PCACHE = 'pcache.ini' try: LOGFILE = cp.get("General","LOGFILE") except: LOGFILE = 'log.txt' try: PIDFILE = cp.get("General","PIDFILE") except: PIDFILE = 'pid' ROOM = cp.get("Conference","ROOM") PWD_ROOM = cp.get("Conference","PWD_ROOM") print NAME,SRV