[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Comments for private Event attributes
commit 115607af56f7e8497c9c3343a4f7eae850b7a8a9
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Tue Dec 4 07:53:23 2012 -0800
Comments for private Event attributes
Adding comments to describe arguments like _POSITIONAL_ARGS and _SKIP_PARSING.
Also dropping _QUOTED entries for key/value entries since it's no longer being
used for that purpose.
---
stem/response/events.py | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/stem/response/events.py b/stem/response/events.py
index 1559ec5..dbd23f9 100644
--- a/stem/response/events.py
+++ b/stem/response/events.py
@@ -28,10 +28,10 @@ class Event(stem.response.ControlMessage):
:var dict keyword_args: key/value arguments of the event
"""
- _POSITIONAL_ARGS = ()
- _KEYWORD_ARGS = {}
- _QUOTED = ()
- _SKIP_PARSING = False
+ _POSITIONAL_ARGS = () # attribute names for recognized positional arguments
+ _KEYWORD_ARGS = {} # map of 'keyword => attribute' for recognized attributes
+ _QUOTED = () # positional arguments that are quoted
+ _SKIP_PARSING = False # skip parsing contents into our positional_args and keyword_args
def _parse_message(self, arrived_at):
if not str(self).strip():
@@ -156,7 +156,7 @@ class AddrMapEvent(Event):
"error": "error",
"EXPIRES": "utc_expiry",
}
- _QUOTED = ("expiry", "EXPIRES")
+ _QUOTED = ("expiry")
def _parse(self):
if self.destination == "<error>":
@@ -387,8 +387,6 @@ class ClientsSeenEvent(Event):
"IPVersions": "ip_versions",
}
- _QUOTED = ("TimeStarted",)
-
def _parse(self):
if self.start_time != None:
self.start_time = datetime.datetime.strptime(self.start_time, "%Y-%m-%d %H:%M:%S")
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits