diff --git a/brathuhn.py b/brathuhn.py index 3a4b650..7ba28fe 100644 --- a/brathuhn.py +++ b/brathuhn.py @@ -205,7 +205,7 @@ def connect_and_join(): con=cl.connect() if not con: print 'could not connect!' - raise 'could not connect!' + raise Exception('could not connect!') print 'connected' cl.RegisterHandler('message',__messageCB) @@ -215,7 +215,7 @@ def connect_and_join(): auth=cl.auth(NAME,PWD,resource=jid.getResource()) if not auth: print 'could not authenticate!' - raise 'could not authenticate!' + raise Exception('could not authenticate!') print 'auth' diff --git a/config.py b/config.py index 6477aa5..c09ce55 100644 --- a/config.py +++ b/config.py @@ -1,9 +1,15 @@ -NAME = "brathuhn" -SRV = "n0g.at" -PWD = "123huhn" +from ConfigParser import ConfigParser +import os -ROOM = "gladio@conference.n0g.at" -PWD_ROOM = "secret" +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") + +ROOM = cp.get("Conference","ROOM") +PWD_ROOM = cp.get("Conference","PWD_ROOM") + +print NAME,SRV -#ROOM = "debug@conference.n0g.at" -#PWD_ROOM = ""