[tor-commits] [stem/master] Cleaning up our TODO comments
atagar at torproject.org
atagar at torproject.org
Sun Feb 17 22:02:36 UTC 2013
commit 4a2e7e74652c2c93654035bede41f203397ed16b
Author: Damian Johnson <atagar at torproject.org>
Date: Sun Feb 17 12:25:43 2013 -0800
Cleaning up our TODO comments
Several of our TODO comments were no longer relevant or could be expanded.
---
stem/control.py | 16 +++++++---------
stem/descriptor/extrainfo_descriptor.py | 6 ++----
stem/response/getconf.py | 2 +-
stem/util/system.py | 4 ----
test/unit/response/protocolinfo.py | 2 --
5 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/stem/control.py b/stem/control.py
index 5c7a54e..d799922 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -662,15 +662,6 @@ class Controller(BaseController):
self._event_listeners = {}
self._event_listeners_lock = threading.RLock()
- # TODO: We want the capability of taking post-authentication actions, for
- # instance to call SETEVENTS so our event listeners will work on new
- # connections. The trouble is that the user could do this by a variety of
- # methods (authenticate(), msg(), stem.connection.authenticete(), etc)...
- #
- # When we get it figured out we should add the pydoc comment:
- # If a new control connection is initialized then this listener will be
- # reattached.
-
# number of sequential 'GETINFO ip-to-country/*' lookups that have failed
self._geoip_failure_count = 0
self._enabled_features = []
@@ -1020,6 +1011,8 @@ class Controller(BaseController):
try:
# TODO: We should iterate over the descriptors as they're read from the
# socket rather than reading the whole thing into memory.
+ #
+ # https://trac.torproject.org/8248
desc_content = self.get_info("desc/all-recent")
@@ -1087,6 +1080,8 @@ class Controller(BaseController):
try:
# TODO: We should iterate over the descriptors as they're read from the
# socket rather than reading the whole thing into memeory.
+ #
+ # https://trac.torproject.org/8248
desc_content = self.get_info("ns/all")
@@ -1423,6 +1418,9 @@ class Controller(BaseController):
controller.add_event_listener(print_bw, EventType.BW)
time.sleep(5)
+ If a new control connection is initialized then this listener will be
+ reattached.
+
:param functor listener: function to be called when an event is received
:param stem.control.EventType events: event types to be listened for
diff --git a/stem/descriptor/extrainfo_descriptor.py b/stem/descriptor/extrainfo_descriptor.py
index c64550c..10bd6fd 100644
--- a/stem/descriptor/extrainfo_descriptor.py
+++ b/stem/descriptor/extrainfo_descriptor.py
@@ -602,10 +602,8 @@ class ExtraInfoDescriptor(stem.descriptor.Descriptor):
if value:
for entry in value.split(","):
try:
- # TODO: The description of the values sound like they should
- # always be positive, but this is not always the case in
- # practice...
- # https://trac.torproject.org/projects/tor/ticket/5849
+ # Values should be positive but as discussed in ticket #5849
+ # there was a bug around this. It was fixed in tor 0.2.2.1.
entries.append(float(entry))
except ValueError:
diff --git a/stem/response/getconf.py b/stem/response/getconf.py
index ce3a2ad..5d32582 100644
--- a/stem/response/getconf.py
+++ b/stem/response/getconf.py
@@ -41,7 +41,7 @@ class GetConfResponse(stem.response.ControlMessage):
line = remaining_lines.pop(0)
if line.is_next_mapping(quoted = False):
- key, value = line.split("=", 1) # TODO: make this part of the ControlLine?
+ key, value = line.split("=", 1)
elif line.is_next_mapping(quoted = True):
# TODO: doesn't seem to occur yet in practice...
# https://trac.torproject.org/6172
diff --git a/stem/util/system.py b/stem/util/system.py
index 3a11161..bc598b1 100644
--- a/stem/util/system.py
+++ b/stem/util/system.py
@@ -401,10 +401,6 @@ def get_pid_by_port(port):
# p - only includes results if the local or foreign port match this
#
# example output:
- # # TODO: We need an example for the actual command we're using. I'm
- # # suspecting that replacing the grep with checking the local port works,
- # # but should double check.
- #
# # sockstat -4 | grep tor
# _tor tor 4397 7 tcp4 51.64.7.84:9050 *:*
# _tor tor 4397 8 udp4 51.64.7.84:53 *:*
diff --git a/test/unit/response/protocolinfo.py b/test/unit/response/protocolinfo.py
index f5ffa66..86309e7 100644
--- a/test/unit/response/protocolinfo.py
+++ b/test/unit/response/protocolinfo.py
@@ -151,8 +151,6 @@ class TestProtocolInfoResponse(unittest.TestCase):
succeeds and fails.
"""
- # TODO: move into stem.connection unit tests?
-
# we need to mock both pid and cwd lookups since the general cookie
# expanion works by...
# - resolving the pid of the "tor" process
More information about the tor-commits
mailing list