From 89e3c2a7035750fa207f4c2ea106e98d7234e85d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 18 Nov 2015 07:43:10 +0100 Subject: [PATCH] Fix lint. --- scripts/asciidoc2html.py | 3 +-- scripts/dev/ua_fetch.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index b22dfd8f8..3e1b78ae3 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -86,7 +86,6 @@ class AsciiDoc: for src, dst in files: self.call(src, dst) - def _build_website_file(self, root, filename): """Build a single website file.""" # pylint: disable=too-many-locals @@ -162,7 +161,7 @@ class AsciiDoc: for root, _dirs, files in os.walk(os.getcwd()): for filename in files: - basename, ext = os.path.splitext(filename) + basename, ext = os.path.splitext(filename) if (ext != '.asciidoc' or basename in ('header', 'OpenSans-License')): continue diff --git a/scripts/dev/ua_fetch.py b/scripts/dev/ua_fetch.py index e2abbd576..38e2fb065 100644 --- a/scripts/dev/ua_fetch.py +++ b/scripts/dev/ua_fetch.py @@ -31,7 +31,11 @@ from lxml import html # pylint: disable=import-error def fetch(): - """Fetch list of popular user-agents and return list of relevant strings""" + """Fetch list of popular user-agents. + + Return: + List of relevant strings. + """ url = 'https://techblog.willshouse.com/2012/01/03/most-common-user-agents/' page = requests.get(url) page = html.fromstring(page.text) @@ -40,7 +44,7 @@ def fetch(): def filter_list(complete_list, browsers): - """Filter the received list based on a look up table + """Filter the received list based on a look up table. The LUT should be a dictionary of the format {browser: versions}, where 'browser' is the name of the browser (eg. "Firefox") as string and @@ -98,13 +102,14 @@ def main(): filtered = add_diversity(filtered) tab = " " - print("%sdef complete(self):" % tab) - print("%s\"\"\"Complete a list of common user agents.\"\"\"" % (2 * tab)) - print("%sout = [" %(2 * tab)) + print(tab + "def complete(self):") + print((2 * tab) + "\"\"\"Complete a list of common user agents.\"\"\"") + print((2 * tab) + "%sout = [") for browser in ["Firefox", "Safari", "Chrome", "Obscure"]: for it in filtered[browser]: - print("%s(\'%s\',\n%s \"%s\")," % (3 * tab, it[0], 3 * tab, it[1])) + print("{}(\'{}\',\n{} \"{}\"),".format(3 * tab, it[0], + 3 * tab, it[1])) print("") print("""\ @@ -112,7 +117,7 @@ def main(): 'Gecko', "IE 11.0 for Desktop Win7 64-bit")""") - print("%s]\n%sreturn out\n" % (2 * tab, 2 * tab)) + print("{}]\n{}return out\n".format(2 * tab, 2 * tab)) if __name__ == '__main__':