commit f4826d5eea7f0ea8777d1a9d2b8afef3fb00efa2 Author: Damian Johnson atagar@torproject.org Date: Sat Aug 16 17:06:51 2014 -0700
Fixing E126 (continuation line over-indented for hanging indent)
Evidently PEP8 doesn't like our multi-line imports. That's fine, the parenthetical imports are just as readable. --- docs/roles.py | 6 +-- test/unit/descriptor/export.py | 6 ++- test/unit/descriptor/microdescriptor.py | 7 +++- test/unit/descriptor/networkstatus/document_v3.py | 41 +++++++++++--------- .../descriptor/networkstatus/key_certificate.py | 10 +++-- test/unit/descriptor/router_status_entry.py | 10 +++-- test/unit/descriptor/server_descriptor.py | 8 ++-- test/unit/exit_policy/policy.py | 10 +++-- 8 files changed, 57 insertions(+), 41 deletions(-)
diff --git a/docs/roles.py b/docs/roles.py index 0130ea3..67e944c 100644 --- a/docs/roles.py +++ b/docs/roles.py @@ -25,8 +25,7 @@ def role_trac(name, rawtext, text, lineno, inliner, options={}, content=[]): if ticket_num <= 0: raise ValueError except ValueError: - msg = inliner.reporter.error( - 'Invalid trac ticket: %s' % text, line=lineno) + msg = inliner.reporter.error('Invalid trac ticket: %s' % text, line=lineno) prb = inliner.problematic(rawtext, rawtext, msg)
return ([prb], [msg]) @@ -48,8 +47,7 @@ def role_spec(name, rawtext, text, lineno, inliner, options={}, content=[]): # checking if the input is a valid short commit id
if not re.match('^[0-9a-f]{7}$', text): - msg = inliner.reporter.error( - 'Spec tag expects a short commit id (seven hex characters): %s' % text, line=lineno) + msg = inliner.reporter.error('Spec tag expects a short commit id (seven hex characters): %s' % text, line=lineno) prb = inliner.problematic(rawtext, rawtext, msg)
return ([prb], [msg]) diff --git a/test/unit/descriptor/export.py b/test/unit/descriptor/export.py index 55429fd..eca2200 100644 --- a/test/unit/descriptor/export.py +++ b/test/unit/descriptor/export.py @@ -10,8 +10,10 @@ import test.runner
from stem.descriptor.export import export_csv, export_csv_file
-from test.mocking import get_relay_server_descriptor, \ - get_bridge_server_descriptor +from test.mocking import ( + get_relay_server_descriptor, + get_bridge_server_descriptor, +)
class TestExport(unittest.TestCase): diff --git a/test/unit/descriptor/microdescriptor.py b/test/unit/descriptor/microdescriptor.py index 2193731..267b01a 100644 --- a/test/unit/descriptor/microdescriptor.py +++ b/test/unit/descriptor/microdescriptor.py @@ -9,8 +9,11 @@ import stem.exit_policy import stem.descriptor
from stem.descriptor.microdescriptor import Microdescriptor -from test.mocking import get_microdescriptor, \ - CRYPTO_BLOB + +from test.mocking import ( + get_microdescriptor, + CRYPTO_BLOB, +)
from test.unit.descriptor import get_resource
diff --git a/test/unit/descriptor/networkstatus/document_v3.py b/test/unit/descriptor/networkstatus/document_v3.py index 7ba034c..261a70f 100644 --- a/test/unit/descriptor/networkstatus/document_v3.py +++ b/test/unit/descriptor/networkstatus/document_v3.py @@ -11,24 +11,29 @@ import stem.version
from stem import Flag
-from stem.descriptor.networkstatus import HEADER_STATUS_DOCUMENT_FIELDS, \ - FOOTER_STATUS_DOCUMENT_FIELDS, \ - DEFAULT_PARAMS, \ - DirectoryAuthority, \ - NetworkStatusDocumentV3, \ - _parse_file - -from stem.descriptor.router_status_entry import \ - RouterStatusEntryV3, \ - RouterStatusEntryMicroV3 - -from test.mocking import get_router_status_entry_v3, \ - get_router_status_entry_micro_v3, \ - get_directory_authority, \ - get_network_status_document_v3, \ - CRYPTO_BLOB, \ - DOC_SIG, \ - NETWORK_STATUS_DOCUMENT_FOOTER +from stem.descriptor.networkstatus import ( + HEADER_STATUS_DOCUMENT_FIELDS, + FOOTER_STATUS_DOCUMENT_FIELDS, + DEFAULT_PARAMS, + DirectoryAuthority, + NetworkStatusDocumentV3, + _parse_file, +) + +from stem.descriptor.router_status_entry import ( + RouterStatusEntryV3, + RouterStatusEntryMicroV3, +) + +from test.mocking import ( + get_router_status_entry_v3, + get_router_status_entry_micro_v3, + get_directory_authority, + get_network_status_document_v3, + CRYPTO_BLOB, + DOC_SIG, + NETWORK_STATUS_DOCUMENT_FOOTER, +)
from test.unit.descriptor import get_resource
diff --git a/test/unit/descriptor/networkstatus/key_certificate.py b/test/unit/descriptor/networkstatus/key_certificate.py index 23ad7ca..34e16a8 100644 --- a/test/unit/descriptor/networkstatus/key_certificate.py +++ b/test/unit/descriptor/networkstatus/key_certificate.py @@ -7,10 +7,12 @@ import unittest
from stem.descriptor.networkstatus import KeyCertificate
-from test.mocking import get_key_certificate, \ - CRYPTO_BLOB, \ - KEY_CERTIFICATE_HEADER, \ - KEY_CERTIFICATE_FOOTER +from test.mocking import ( + get_key_certificate, + CRYPTO_BLOB, + KEY_CERTIFICATE_HEADER, + KEY_CERTIFICATE_FOOTER, +)
class TestKeyCertificate(unittest.TestCase): diff --git a/test/unit/descriptor/router_status_entry.py b/test/unit/descriptor/router_status_entry.py index 77b4e20..4c9a13a 100644 --- a/test/unit/descriptor/router_status_entry.py +++ b/test/unit/descriptor/router_status_entry.py @@ -10,10 +10,12 @@ from stem.descriptor.router_status_entry import RouterStatusEntryV3, _base64_to_ from stem.exit_policy import MicroExitPolicy from stem.version import Version
-from test.mocking import get_router_status_entry_v2, \ - get_router_status_entry_v3, \ - get_router_status_entry_micro_v3, \ - ROUTER_STATUS_ENTRY_V3_HEADER +from test.mocking import ( + get_router_status_entry_v2, + get_router_status_entry_v3, + get_router_status_entry_micro_v3, + ROUTER_STATUS_ENTRY_V3_HEADER, +)
class TestRouterStatusEntry(unittest.TestCase): diff --git a/test/unit/descriptor/server_descriptor.py b/test/unit/descriptor/server_descriptor.py index c3f429a..96dab1c 100644 --- a/test/unit/descriptor/server_descriptor.py +++ b/test/unit/descriptor/server_descriptor.py @@ -15,9 +15,11 @@ import stem.util.str_tools
from stem.descriptor.server_descriptor import RelayDescriptor, BridgeDescriptor
-from test.mocking import get_relay_server_descriptor, \ - get_bridge_server_descriptor, \ - CRYPTO_BLOB +from test.mocking import ( + get_relay_server_descriptor, + get_bridge_server_descriptor, + CRYPTO_BLOB, +)
from test.unit.descriptor import get_resource
diff --git a/test/unit/exit_policy/policy.py b/test/unit/exit_policy/policy.py index 4965aac..70d6ac1 100644 --- a/test/unit/exit_policy/policy.py +++ b/test/unit/exit_policy/policy.py @@ -5,10 +5,12 @@ Unit tests for the stem.exit_policy.ExitPolicy class. import pickle import unittest
-from stem.exit_policy import get_config_policy, \ - ExitPolicy, \ - MicroExitPolicy, \ - ExitPolicyRule +from stem.exit_policy import ( + get_config_policy, + ExitPolicy, + MicroExitPolicy, + ExitPolicyRule, +)
class TestExitPolicy(unittest.TestCase):
tor-commits@lists.torproject.org