commit bb0a3ace259e4f23eb53837908a3163c1c19e305 Author: Eoin o Fearghail eoin.o.fearghail@gmail.com Date: Tue Nov 6 00:00:51 2012 +0000
Changing spelling of parseable to parsable, also one tiny whitespace fix. --- stem/descriptor/extrainfo_descriptor.py | 4 ++-- stem/descriptor/networkstatus.py | 10 +++++----- stem/descriptor/router_status_entry.py | 2 +- stem/descriptor/server_descriptor.py | 2 +- test/unit/descriptor/networkstatus/document_v3.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/stem/descriptor/extrainfo_descriptor.py b/stem/descriptor/extrainfo_descriptor.py index 76adfbf..1bb8dac 100644 --- a/stem/descriptor/extrainfo_descriptor.py +++ b/stem/descriptor/extrainfo_descriptor.py @@ -173,7 +173,7 @@ def _parse_timestamp_and_interval(keyword, content): timestamp = datetime.datetime.strptime(timestamp_str, "%Y-%m-%d %H:%M:%S") return timestamp, int(interval), remainder except ValueError: - raise ValueError("%s line's timestamp wasn't parseable: %s" % (keyword, line)) + raise ValueError("%s line's timestamp wasn't parsable: %s" % (keyword, line))
class ExtraInfoDescriptor(stem.descriptor.Descriptor): """ @@ -589,7 +589,7 @@ class ExtraInfoDescriptor(stem.descriptor.Descriptor): self.geoip_start_time = timestamp except ValueError: if validate: - raise ValueError("Timestamp on %s line wasn't parseable: %s" % (keyword, line)) + raise ValueError("Timestamp on %s line wasn't parsable: %s" % (keyword, line)) elif keyword in ("cell-stats-end", "entry-stats-end", "exit-stats-end", "bridge-stats-end", "dirreq-stats-end"): # "<keyword>" YYYY-MM-DD HH:MM:SS (NSEC s)
diff --git a/stem/descriptor/networkstatus.py b/stem/descriptor/networkstatus.py index 5649d53..0c08611 100644 --- a/stem/descriptor/networkstatus.py +++ b/stem/descriptor/networkstatus.py @@ -14,7 +14,7 @@ dir-spec. Documents can be obtained from a few sources... * document footer
Of these, the router status entry section can be quite large (on the order of -hundreds of kilobytes). As such we provide a couple of methods for reading +hundreds of kilobytes). As such we provide a couple of methods for reading network status documents...
* :class:`stem.descriptor.networkstatus.NetworkStatusDocumentV3` constructor @@ -366,7 +366,7 @@ class NetworkStatusDocumentV2(NetworkStatusDocument): self.published = datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S") except ValueError: if validate: - raise ValueError("Version 2 network status document's 'published' time wasn't parseable: %s" % value) + raise ValueError("Version 2 network status document's 'published' time wasn't parsable: %s" % value) elif keyword == "dir-options": self.options = value.split() elif keyword == "directory-signature": @@ -628,7 +628,7 @@ class _DocumentHeader(object): self.valid_until = date_value except ValueError: if validate: - raise ValueError("Network status document's '%s' time wasn't parseable: %s" % (keyword, value)) + raise ValueError("Network status document's '%s' time wasn't parsable: %s" % (keyword, value)) elif keyword == "voting-delay": # "voting-delay" VoteSeconds DistSeconds
@@ -650,7 +650,7 @@ class _DocumentHeader(object): self.server_versions.append(version_value) except ValueError: if validate: - raise ValueError("Network status document's '%s' line had '%s', which isn't a parseable tor version: %s" % (keyword, entry, line)) + raise ValueError("Network status document's '%s' line had '%s', which isn't a parsable tor version: %s" % (keyword, entry, line)) elif keyword == "known-flags": # "known-flags" FlagList
@@ -1192,7 +1192,7 @@ class KeyCertificate(stem.descriptor.Descriptor): self.expires = date_value except ValueError: if validate: - raise ValueError("Key certificate's '%s' time wasn't parseable: %s" % (keyword, value)) + raise ValueError("Key certificate's '%s' time wasn't parsable: %s" % (keyword, value)) elif keyword in ('dir-identity-key', 'dir-signing-key', 'dir-key-crosscert', 'dir-key-certification'): # "dir-identity-key" NL a public key in PEM format # "dir-signing-key" NL a key in PEM format diff --git a/stem/descriptor/router_status_entry.py b/stem/descriptor/router_status_entry.py index 239e6bb..61f03e8 100644 --- a/stem/descriptor/router_status_entry.py +++ b/stem/descriptor/router_status_entry.py @@ -425,7 +425,7 @@ def _parse_r_line(desc, value, validate, include_digest = True): desc.published = datetime.datetime.strptime(published, "%Y-%m-%d %H:%M:%S") except ValueError: if validate: - raise ValueError("Publication time time wasn't parseable: r %s" % value) + raise ValueError("Publication time time wasn't parsable: r %s" % value)
def _parse_s_line(desc, value, validate): # "s" Flags diff --git a/stem/descriptor/server_descriptor.py b/stem/descriptor/server_descriptor.py index 68b2da3..046dfe1 100644 --- a/stem/descriptor/server_descriptor.py +++ b/stem/descriptor/server_descriptor.py @@ -398,7 +398,7 @@ class ServerDescriptor(stem.descriptor.Descriptor): self.published = datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S") except ValueError: if validate: - raise ValueError("Published line's time wasn't parseable: %s" % line) + raise ValueError("Published line's time wasn't parsable: %s" % line) elif keyword == "fingerprint": # This is forty hex digits split into space separated groups of four. # Checking that we match this pattern. diff --git a/test/unit/descriptor/networkstatus/document_v3.py b/test/unit/descriptor/networkstatus/document_v3.py index 47ce4a9..11c9a9f 100644 --- a/test/unit/descriptor/networkstatus/document_v3.py +++ b/test/unit/descriptor/networkstatus/document_v3.py @@ -687,7 +687,7 @@ class TestNetworkStatusDocument(unittest.TestCase):
content = get_network_status_document_v3({"directory-signature": "%s %s\n%s" % tuple(attrs)}, content = True) self.assertRaises(ValueError, NetworkStatusDocumentV3, content) - NetworkStatusDocumentV3(content, False) # checks that it's still parseable without validation + NetworkStatusDocumentV3(content, False) # checks that it's still parsable without validation
def test_with_router_status_entries(self): """
tor-commits@lists.torproject.org