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

[or-cvs] r16177: Add a couple of comments about using __metaclass__ for more (torctl/trunk/python/TorCtl)



Author: mikeperry
Date: 2008-07-24 09:23:24 -0400 (Thu, 24 Jul 2008)
New Revision: 16177

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

Add a couple of comments about using __metaclass__ for more
flexible class construction.



Modified: torctl/trunk/python/TorCtl/PathSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/PathSupport.py	2008-07-24 12:38:29 UTC (rev 16176)
+++ torctl/trunk/python/TorCtl/PathSupport.py	2008-07-24 13:23:24 UTC (rev 16177)
@@ -927,6 +927,7 @@
 
 # TODO: Make passive "PathWatcher" so people can get aggregate 
 # node reliability stats for normal usage without us attaching streams
+# Can use __metaclass__ and type
 
 class PathBuilder(TorCtl.EventHandler):
   """

Modified: torctl/trunk/python/TorCtl/StatsSupport.py
===================================================================
--- torctl/trunk/python/TorCtl/StatsSupport.py	2008-07-24 12:38:29 UTC (rev 16176)
+++ torctl/trunk/python/TorCtl/StatsSupport.py	2008-07-24 13:23:24 UTC (rev 16177)
@@ -184,12 +184,12 @@
     self.dev = self._dev()
 
 
-
 class StatsRouter(TorCtl.Router):
   "Extended Router to handle statistics markup"
   def __init__(self, router): # Promotion constructor :)
     """'Promotion Constructor' that converts a Router directly into a 
     StatsRouter without a copy."""
+    # TODO: Use __metaclass__ and type to do this instead?
     self.__dict__ = router.__dict__
     self.reset()
   
@@ -333,7 +333,7 @@
                     +str(per_hour_tot) +" vs "+str(chosen_tot))
 
 
-
+# TODO: Use __metaclass__ and type to make this inheritance flexible?
 class StatsHandler(PathSupport.PathBuilder):
   """An extension of PathSupport.PathBuilder that keeps track of 
      router statistics for every circuit and stream"""