[tor-commits] [stem/master] Conforming to E502 (backslash to split lines)

atagar at torproject.org atagar at torproject.org
Mon Jan 7 09:08:00 UTC 2013


commit b25d5332a8b10c70211c83df9f48ea7b97710fde
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jan 6 19:47:55 2013 -0800

    Conforming to E502 (backslash to split lines)
    
    Ok, this one I think is stupid. "Thou shalt not have long lines" says PEP8,
    "... and thou shalt not spit up thy long lines."
    
    In two of the instances I agree, it wasn't buying us anything. But in the third
    it was actually making things more readable.
    
    Oh well, I'm not gonna put up a fuss over just one line of code.
---
 stem/descriptor/extrainfo_descriptor.py |    3 +--
 stem/response/getconf.py                |    3 +--
 stem/response/getinfo.py                |    3 +--
 test/check_whitespace.py                |    2 +-
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/stem/descriptor/extrainfo_descriptor.py b/stem/descriptor/extrainfo_descriptor.py
index 284681b..25c9a82 100644
--- a/stem/descriptor/extrainfo_descriptor.py
+++ b/stem/descriptor/extrainfo_descriptor.py
@@ -645,8 +645,7 @@ class ExtraInfoDescriptor(stem.descriptor.Descriptor):
           stats = remainder.split(",")
           
           if len(stats) != 4 or not \
-            (stats[0].isdigit() and stats[1].isdigit() and \
-             stats[2].isdigit() and stats[3].isdigit()):
+            (stats[0].isdigit() and stats[1].isdigit() and stats[2].isdigit() and stats[3].isdigit()):
             raise ValueError("conn-bi-direct line should end with four numeric values: %s" % line)
           
           self.conn_bi_direct_end = timestamp
diff --git a/stem/response/getconf.py b/stem/response/getconf.py
index 879c5c0..f8d55e7 100644
--- a/stem/response/getconf.py
+++ b/stem/response/getconf.py
@@ -31,8 +31,7 @@ class GetConfResponse(stem.response.ControlMessage):
           unrecognized_keywords.append(line[32:-1])
       
       if unrecognized_keywords:
-        raise stem.InvalidArguments("552", "GETCONF request contained unrecognized keywords: %s" \
-            % ', '.join(unrecognized_keywords), unrecognized_keywords)
+        raise stem.InvalidArguments("552", "GETCONF request contained unrecognized keywords: %s" % ', '.join(unrecognized_keywords), unrecognized_keywords)
       else:
         raise stem.ProtocolError("GETCONF response contained a non-OK status code:\n%s" % self)
     
diff --git a/stem/response/getinfo.py b/stem/response/getinfo.py
index c33618b..e68d4ae 100644
--- a/stem/response/getinfo.py
+++ b/stem/response/getinfo.py
@@ -31,8 +31,7 @@ class GetInfoResponse(stem.response.ControlMessage):
           unrecognized_keywords.append(line[18:-1])
       
       if unrecognized_keywords:
-        raise stem.InvalidArguments("552", "GETINFO request contained unrecognized keywords: %s\n" \
-            % ', '.join(unrecognized_keywords), unrecognized_keywords)
+        raise stem.InvalidArguments("552", "GETINFO request contained unrecognized keywords: %s\n" % ', '.join(unrecognized_keywords), unrecognized_keywords)
       else:
         raise stem.ProtocolError("GETINFO response didn't have an OK status:\n%s" % self)
     
diff --git a/test/check_whitespace.py b/test/check_whitespace.py
index dacd594..50fec10 100644
--- a/test/check_whitespace.py
+++ b/test/check_whitespace.py
@@ -47,7 +47,7 @@ def pep8_issues(base_path = DEFAULT_TARGET):
   # We're gonna trim these down by cateogry but include the pep8 checks to
   # prevent regression.
   
-  ignored_issues = "E111,E121,W293,E501,E302,E701,E251,E261,W391,E127,E241,E128,E226,E231,E202,E201,E203,E124,E211,E222,E225,E221,E126,E262,E271,E502"
+  ignored_issues = "E111,E121,W293,E501,E302,E701,E251,E261,W391,E127,E241,E128,E226,E231,E202,E201,E203,E124,E211,E222,E225,E221,E126,E262,E271"
   
   issues = {}
   pep8_output = system.call("pep8 --ignore %s %s" % (ignored_issues, base_path))





More information about the tor-commits mailing list