[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] fix a pair of tracebacks when you ask for config/infos that...
Update of /home/or/cvsroot/control/python
In directory moria:/tmp/cvs-serv29705
Modified Files:
TorExample.py
Log Message:
fix a pair of tracebacks when you ask for config/infos that don't exist
Index: TorExample.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorExample.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- TorExample.py 13 Jul 2005 00:09:08 -0000 1.6
+++ TorExample.py 13 Jul 2005 06:28:42 -0000 1.7
@@ -63,14 +63,22 @@
def run_get_config():
conn = getConnection()
- opts = conn.get_option(sys.argv[1:])
+ try:
+ opts = conn.get_option(sys.argv[1:])
+ except ErrorReply, e:
+ print "Lookup failed: %s."%e
+ return
for k,v in opts:
print "KEY:",k
print "VALUE:",v
def run_get_info():
conn = getConnection()
- opts = conn.get_info(sys.argv[1:])
+ try:
+ opts = conn.get_info(sys.argv[1:])
+ except ErrorReply, e:
+ print "Lookup failed: %s."%e
+ return
for k in sys.argv[1:]:
print "KEY:",k
print "VALUE:",opts.get(k)