From e77a4481f848e7111def0398026c9fd934eb7642 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 27 Nov 2016 18:47:17 +0100 Subject: [PATCH] Some whitespace fixes to make newer versions of flake8 happy --- scour/scour.py | 2 ++ scour/svg_regex.py | 3 +++ scour/svg_transform.py | 3 +++ testcss.py | 1 + 4 files changed, 9 insertions(+) diff --git a/scour/scour.py b/scour/scour.py index a1b99cf..a6dede0 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -405,6 +405,7 @@ default_properties = { # excluded all properties with 'auto' as default def isSameSign(a, b): return (a <= 0 and b <= 0) or (a >= 0 and b >= 0) + scinumber = re.compile(r"[-+]?(\d*\.?)?\d+[eE][-+]?\d+") number = re.compile(r"[-+]?(\d*\.?)?\d+") sciExponent = re.compile(r"[eE]([-+]?\d+)") @@ -1945,6 +1946,7 @@ def removeDefaultAttributeValues(node, options, tainted=set()): return num + rgb = re.compile(r"\s*rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*") rgbp = re.compile(r"\s*rgb\(\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*\)\s*") diff --git a/scour/svg_regex.py b/scour/svg_regex.py index 0926363..d4dfe3a 100644 --- a/scour/svg_regex.py +++ b/scour/svg_regex.py @@ -55,6 +55,8 @@ class _EOF(object): def __repr__(self): return 'EOF' + + EOF = _EOF() lexicon = [ @@ -97,6 +99,7 @@ class Lexer(object): break yield (EOF, None) + svg_lexer = Lexer(lexicon) diff --git a/scour/svg_transform.py b/scour/svg_transform.py index 944d34c..83454b3 100644 --- a/scour/svg_transform.py +++ b/scour/svg_transform.py @@ -70,6 +70,8 @@ class _EOF(object): def __repr__(self): return 'EOF' + + EOF = _EOF() lexicon = [ @@ -114,6 +116,7 @@ class Lexer(object): break yield (EOF, None) + svg_lexer = Lexer(lexicon) diff --git a/testcss.py b/testcss.py index a342b5e..d7fd3e2 100755 --- a/testcss.py +++ b/testcss.py @@ -52,5 +52,6 @@ class ElementSelectorWithProperty(unittest.TestCase): self.assertEqual(len(r[0]['properties']), 1, 'Property list for foo did not have 1') self.assertEqual(r[0]['properties']['bar'], 'baz', 'Property bar did not have baz value') + if __name__ == '__main__': unittest.main()