commit 92ab865999a3e6a4ed21311560e4b15c22ad4139 Author: Damian Johnson atagar@torproject.org Date: Fri Nov 23 11:02:44 2012 -0800
Replacing GMT refrences with UTC
Accouning for the spec change... https://gitweb.torproject.org/torspec.git/commitdiff/d581e63 --- stem/descriptor/extrainfo_descriptor.py | 2 +- stem/descriptor/server_descriptor.py | 2 +- stem/response/events.py | 8 ++++---- test/unit/response/events.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/stem/descriptor/extrainfo_descriptor.py b/stem/descriptor/extrainfo_descriptor.py index ec259a8..1ad5d46 100644 --- a/stem/descriptor/extrainfo_descriptor.py +++ b/stem/descriptor/extrainfo_descriptor.py @@ -196,7 +196,7 @@ class ExtraInfoDescriptor(stem.descriptor.Descriptor):
:var str nickname: ***** relay's nickname :var str fingerprint: ***** identity key fingerprint - :var datetime published: ***** time in GMT when this descriptor was made + :var datetime published: ***** time in UTC when this descriptor was made :var str geoip_db_digest: sha1 of geoIP database file :var dict transport: ***** mapping of transport methods to their (address, port, args) tuple, these usually appear on bridges in which case all of diff --git a/stem/descriptor/server_descriptor.py b/stem/descriptor/server_descriptor.py index a1d4055..584d426 100644 --- a/stem/descriptor/server_descriptor.py +++ b/stem/descriptor/server_descriptor.py @@ -132,7 +132,7 @@ class ServerDescriptor(stem.descriptor.Descriptor):
:var str nickname: ***** relay's nickname :var str fingerprint: identity key fingerprint - :var datetime published: ***** time in GMT when this descriptor was made + :var datetime published: ***** time in UTC when this descriptor was made
:var str address: ***** IPv4 address of the relay :var int or_port: ***** port used for relaying diff --git a/stem/response/events.py b/stem/response/events.py index f6027aa..c066097 100644 --- a/stem/response/events.py +++ b/stem/response/events.py @@ -143,7 +143,7 @@ class AddrMapEvent(Event): resolution failed :var datetime expiry: expiration time of the resolution in local time :var str error: error code if the resolution failed - :var datetime gmt_expiry: expiration time of the resolution in gmt + :var datetime utc_expiry: expiration time of the resolution in UTC """
# TODO: The spec for this event is a little vague. Making a couple guesses @@ -154,7 +154,7 @@ class AddrMapEvent(Event): _POSITIONAL_ARGS = ("hostname", "destination", "expiry") _KEYWORD_ARGS = { "error": "error", - "EXPIRES": "gmt_expiry", + "EXPIRES": "utc_expiry", } _QUOTED = ("expiry", "EXPIRES")
@@ -165,8 +165,8 @@ class AddrMapEvent(Event): if self.expiry != None: self.expiry = datetime.datetime.strptime(self.expiry, "%Y-%m-%d %H:%M:%S")
- if self.gmt_expiry != None: - self.gmt_expiry = datetime.datetime.strptime(self.gmt_expiry, "%Y-%m-%d %H:%M:%S") + if self.utc_expiry != None: + self.utc_expiry = datetime.datetime.strptime(self.utc_expiry, "%Y-%m-%d %H:%M:%S")
class AuthDirNewDescEvent(Event): """ diff --git a/test/unit/response/events.py b/test/unit/response/events.py index c0d1fca..ef2699e 100644 --- a/test/unit/response/events.py +++ b/test/unit/response/events.py @@ -136,7 +136,7 @@ class TestEvents(unittest.TestCase): self.assertEqual("75.119.206.243", event.destination) self.assertEqual(datetime.datetime(2012, 11, 19, 0, 50, 13), event.expiry) self.assertEqual(None, event.error) - self.assertEqual(datetime.datetime(2012, 11, 19, 8, 50, 13), event.gmt_expiry) + self.assertEqual(datetime.datetime(2012, 11, 19, 8, 50, 13), event.utc_expiry)
def test_authdir_newdesc_event(self): # TODO: We aren't actually parsing the event yet. Until then we can only
tor-commits@lists.torproject.org