Jabber/XMPP conference bot & framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
brathuhn/sys/config.py

58 lines
976 B

from ConfigParser import ConfigParser
import os
cp = ConfigParser()
cp.read(["/etc/brathuhn/config.cfg","brathuhn.cfg",os.path.expanduser('~/.brathuhn.cfg')])
##
## Account
##
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:
RECONNECT_INTERVAL = int(cp.get("Account","RECONNECT_INTERVAL"))
except:
RECONNECT_INTERVAL = 300
##
## General
##
try:
PCACHE = cp.get("General","PCACHE")
except:
PCACHE = 'pcache.ini'
print PCACHE
try:
LOGFILE = cp.get("General","LOGFILE")
except:
LOGFILE = 'log.txt'
try:
PIDFILE = cp.get("General","PIDFILE")
except:
PIDFILE = 'pid'
try:
LOCAL_IP = cp.get("General","LOCAL_IP")
except:
LOCAL_IP = '127.0.0.1'
try:
S5B_PROXY = cp.get("General","PROXY")
except:
S5B_PROXY = 'proxy.jabbim.cz'
##
## Conference
##
ROOM = cp.get("Conference","ROOM")
PWD_ROOM = cp.get("Conference","PWD_ROOM")
print NAME,SRV