[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Implement resetConf in controller libraries



Update of /home/or/cvsroot/control/python
In directory moria:/tmp/cvs-serv30265/python

Modified Files:
	TorCtl0.py TorCtl1.py 
Log Message:
Implement resetConf in controller libraries

Index: TorCtl0.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl0.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- TorCtl0.py	11 Jul 2005 19:16:40 -0000	1.3
+++ TorCtl0.py	27 Sep 2005 17:36:38 -0000	1.4
@@ -405,6 +405,10 @@
         msg = "".join(["%s %s\n" for k,v in kvlist])
         self._sendAndRecv(MSG_TYPE.SETCONF,msg)
 
+    def reset_options(self, keylist):
+        msg = "".join(["%s\n" for k in keylist])
+        self._sendAndRecv(MSG_TYPE.SETCONF,msg)
+
     def get_info(self,name):
         """Return the value of the internal information field named
            'name'.  To retrieve multiple values, pass a list for

Index: TorCtl1.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl1.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- TorCtl1.py	14 Jul 2005 20:26:11 -0000	1.5
+++ TorCtl1.py	27 Sep 2005 17:36:38 -0000	1.6
@@ -261,6 +261,15 @@
         msg = " ".join(["%s=%s"%(k,_quote(v)) for k,v in kvlist])
         self._sendAndRecv("SETCONF %s\r\n"%msg)
 
+    def reset_options(self, keylist):
+        """Reset the options listed in 'keylist' to their default values.
+
+           Tor started implementing this command in version 0.1.1.7-alpha;
+           previous versions wanted you to set configuration keys to "".
+           That no longer works.
+        """
+        self._sendAndRecv("RESETCONF %s\r\n"%(" ".join(keylist)))
+
     def get_info(self, name):
         """Return the value of the internal information field named 'named'.
            DOCDOC