[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [pytorctl/master] Add gitignore and status returns set_option(s) and reset_options
commit b71e657f13294741d7b6203e587337f677610d14
Author: Tomas Touceda <chiiph@xxxxxxxxxx>
Date: Thu Feb 24 00:20:56 2011 -0300
Add gitignore and status returns set_option(s) and reset_options
---
.gitignore | 2 ++
TorCtl.py | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b7fa6fb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.pyc
+*.swp*
diff --git a/TorCtl.py b/TorCtl.py
index d2cb2a9..3262d69 100755
--- a/TorCtl.py
+++ b/TorCtl.py
@@ -1001,7 +1001,7 @@ class Connection:
def set_option(self, key, value):
"""Set the value of the configuration option 'key' to the value 'value'.
"""
- self.set_options([(key, value)])
+ return self.set_options([(key, value)])
def set_options(self, kvlist):
"""Given a list of (key,value) pairs, set them as configuration
@@ -1010,7 +1010,7 @@ class Connection:
if not kvlist:
return
msg = " ".join(["%s=\"%s\""%(k,quote(v)) for k,v in kvlist])
- self.sendAndRecv("SETCONF %s\r\n"%msg)
+ return self.sendAndRecv("SETCONF %s\r\n"%msg)
def reset_options(self, keylist):
"""Reset the options listed in 'keylist' to their default values.
@@ -1019,7 +1019,7 @@ class Connection:
previous versions wanted you to set configuration keys to "".
That no longer works.
"""
- self.sendAndRecv("RESETCONF %s\r\n"%(" ".join(keylist)))
+ return self.sendAndRecv("RESETCONF %s\r\n"%(" ".join(keylist)))
def get_consensus(self):
"""Get the pristine Tor Consensus. Returns a list of
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits