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

[or-cvs] r18346: {torctl} Fix restriction stringification. (torctl/trunk/python/TorCtl)



Author: mikeperry
Date: 2009-01-30 10:49:18 -0500 (Fri, 30 Jan 2009)
New Revision: 18346

Modified:
   torctl/trunk/python/TorCtl/PathSupport.py
Log:

Fix restriction stringification.



Modified: torctl/trunk/python/TorCtl/PathSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/PathSupport.py	2009-01-30 15:39:47 UTC (rev 18345)
+++ torctl/trunk/python/TorCtl/PathSupport.py	2009-01-30 15:49:18 UTC (rev 18346)
@@ -109,7 +109,7 @@
           self.restrictions)
 
   def __str__(self):
-    return str(self.restrictions)
+    return self.__class__.__name__+"("+str(map(str, self.restrictions))+")"
 
 class PathRestriction:
   "Interface for path restriction policies"
@@ -141,7 +141,7 @@
           self.restrictions)
 
   def __str__(self):
-    return str(self.restrictions)
+    return self.__class__.__name__+"("+str(map(str, self.restrictions))+")"
 
 class NodeGenerator:
   "Interface for node generation"
@@ -351,7 +351,7 @@
     return True
 
   def __str__(self):
-    return self.__class__.__name__+"("+str(self.exclude)+")"
+    return self.__class__.__name__+"("+str(map(str, self.exclude))+")"
 
 class VersionRangeRestriction(NodeRestriction):
   """Require that the versions be inside a specified range""" 
@@ -401,7 +401,7 @@
     return False
 
   def __str__(self):
-    return self.__class__.__name__+"("+str(self.rstrs)+")"
+    return self.__class__.__name__+"("+str(map(str, self.rstrs))+")"
 
 class NotNodeRestriction(MetaNodeRestriction):
   """Negates a single restriction"""
@@ -429,7 +429,7 @@
     else: return True
 
   def __str__(self):
-    return self.__class__.__name__+"("+str(self.rstrs)+","+str(self.n)+")"
+    return self.__class__.__name__+"("+str(map(str, self.rstrs))+","+str(self.n)+")"
 
 
 #################### Path Restrictions #####################