[elbe-devel] [PATCH v2 15/15] pylint validate: fix style problems

Torben Hohn torben.hohn at linutronix.de
Thu May 16 09:05:36 CEST 2019


pycodestyle complains:

elbepack/validate.py:16:34: E227 missing whitespace around bitwise or shift operator
elbepack/validate.py:59:1: E302 expected 2 blank lines, found 1
elbepack/validate.py:72:80: E501 line too long (80 > 79 characters)
elbepack/validate.py:75:13: E128 continuation line under-indented for visual indent

fix it.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/validate.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/elbepack/validate.py b/elbepack/validate.py
index 02435a96b..868603628 100644
--- a/elbepack/validate.py
+++ b/elbepack/validate.py
@@ -13,7 +13,7 @@ from lxml.etree import XMLParser, parse
 
 
 def validate_xml(fname):
-    if os.path.getsize(fname) > 1<<30:
+    if os.path.getsize(fname) > (1 << 30):
         return ["%s is greater than 1 GiB. "
                 "Elbe does not support files of this size." % fname]
 
@@ -56,6 +56,7 @@ def validate_xml(fname):
 
     return errors
 
+
 def validate_xml_content(xml):
     errors = []
 
@@ -69,10 +70,12 @@ def validate_xml_content(xml):
                       "Use debootstrapvariant's attribute includepkgs "
                       "to make gnupg available in debootstrap.\n")
 
-    https = xml.findtext("/project/mirror/primary_proto", "").lower() == "https"
+    primary_proto = xml.findtext("/project/mirror/primary_proto", "")
+    https = (primary_proto.lower() == "https")
 
-    if not https and (dbsv is None
-            or "apt-transport-https" not in dbsv.get("includepkgs", "")):
+    if (not https
+        and (dbsv is None
+             or "apt-transport-https" not in dbsv.get("includepkgs", ""))):
         for url in xml.findall("/project/mirror/url-list/url"):
             b = url.findtext("binary", "")
             s = url.findtext("source", "")
-- 
2.11.0




More information about the elbe-devel mailing list