From a9f2655dbe8702a8f8cf700990720801aed0e138 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 8 Dec 2018 19:27:27 +0900 Subject: [PATCH 1/6] hwdb: drop comment --- hwdb/ids_parser.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hwdb/ids_parser.py b/hwdb/ids_parser.py index c80d22258a3..61ca0ca6e05 100755 --- a/hwdb/ids_parser.py +++ b/hwdb/ids_parser.py @@ -17,7 +17,6 @@ TAB = White('\t', exact=1).suppress() COMMENTLINE = pythonStyleComment + EOL EMPTYLINE = LineEnd() text_eol = lambda name: Regex(r'[^\n]+')(name) + EOL -# text_eol = lambda name: Word(printables + ' ' + '®üäßçõãİó ×²⁶´‐“\u200E\u200B')(name) + EOL def klass_grammar(): klass_line = Literal('C ').suppress() + NUM2('klass') + text_eol('text') From af182e786ccd8157633b93dbb312a21ff99588d1 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 8 Dec 2018 19:31:24 +0900 Subject: [PATCH 2/6] hwdb: drop unused imported object --- hwdb/parse_hwdb.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py index 4900a257787..89efc28925c 100755 --- a/hwdb/parse_hwdb.py +++ b/hwdb/parse_hwdb.py @@ -30,8 +30,7 @@ import sys import os try: - from pyparsing import (Word, White, Literal, ParserElement, Regex, - LineStart, LineEnd, + from pyparsing import (Word, White, Literal, ParserElement, Regex, LineEnd, OneOrMore, Combine, Or, Optional, Suppress, Group, nums, alphanums, printables, stringEnd, pythonStyleComment, QuotedString, From 2f6c9b6f3fb0128cee7f74985c143b4850feff6d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 8 Dec 2018 19:33:37 +0900 Subject: [PATCH 3/6] tools: drop unused variable --- tools/gdb-sd_dump_hashmaps.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/gdb-sd_dump_hashmaps.py b/tools/gdb-sd_dump_hashmaps.py index ea151601075..0701d139e27 100644 --- a/tools/gdb-sd_dump_hashmaps.py +++ b/tools/gdb-sd_dump_hashmaps.py @@ -16,7 +16,6 @@ class sd_dump_hashmaps(gdb.Command): d = gdb.parse_and_eval("hashmap_debug_list") all_entry_sizes = gdb.parse_and_eval("all_entry_sizes") all_direct_buckets = gdb.parse_and_eval("all_direct_buckets") - hashmap_base_t = gdb.lookup_type("HashmapBase") uchar_t = gdb.lookup_type("unsigned char") ulong_t = gdb.lookup_type("unsigned long") debug_offset = gdb.parse_and_eval("(unsigned long)&((HashmapBase*)0)->debug") From fc1c09e1dfd2073fb49c4e7bb87102c88a551876 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 8 Dec 2018 20:51:56 +0900 Subject: [PATCH 4/6] lgtm: use python3 --- .lgtm.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.lgtm.yml b/.lgtm.yml index 37f9c4335c2..5948d8c2bc0 100644 --- a/.lgtm.yml +++ b/.lgtm.yml @@ -8,3 +8,6 @@ extraction: after_prepare: - pip3 install meson - export PATH="$HOME/.local/bin/:$PATH" + python: + python_setup: + version: 3 From 87421ff560028d9b37ed6749a0c7e3da579a8793 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 10 Dec 2018 03:08:52 +0900 Subject: [PATCH 5/6] tools: add one more SPDX license header --- tools/generate-gperfs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/generate-gperfs.py b/tools/generate-gperfs.py index aca9ab1fe91..5392df0ebbb 100755 --- a/tools/generate-gperfs.py +++ b/tools/generate-gperfs.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1+ -"""Generate %-from-name.gperf from %-list.txt +""" +Generate %-from-name.gperf from %-list.txt """ import sys From d8a0bcfd77832357f7db43e072a7ff783dffd369 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 10 Dec 2018 03:17:33 +0900 Subject: [PATCH 6/6] tree-wide: drop header for emacs from python scripts --- hwdb/parse_hwdb.py | 3 +-- src/test/test-systemd-tmpfiles.py | 10 +++++----- tools/catalog-report.py | 1 - tools/gdb-sd_dump_hashmaps.py | 1 - tools/make-directive-index.py | 1 - tools/make-man-index.py | 1 - tools/make-man-rules.py | 3 +-- tools/xml_helper.py | 3 +-- 8 files changed, 8 insertions(+), 15 deletions(-) diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py index 89efc28925c..d84fba2221a 100755 --- a/hwdb/parse_hwdb.py +++ b/hwdb/parse_hwdb.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ -# SPDX-License-Identifier: MIT +# SPDX-License-Identifier: MIT # # This file is distributed under the MIT license, see below. # diff --git a/src/test/test-systemd-tmpfiles.py b/src/test/test-systemd-tmpfiles.py index 28dadd0c5b4..83a66e87723 100755 --- a/src/test/test-systemd-tmpfiles.py +++ b/src/test/test-systemd-tmpfiles.py @@ -1,10 +1,10 @@ #!/usr/bin/env python3 -# SPDX-License-Identifier: LGPL-2.1+ +# SPDX-License-Identifier: LGPL-2.1+ # -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. import os import sys diff --git a/tools/catalog-report.py b/tools/catalog-report.py index b65869d02b6..ca1e13df9a9 100755 --- a/tools/catalog-report.py +++ b/tools/catalog-report.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # SPDX-License-Identifier: MIT # # This file is distributed under the MIT license, see below. diff --git a/tools/gdb-sd_dump_hashmaps.py b/tools/gdb-sd_dump_hashmaps.py index 0701d139e27..4e8593f3200 100644 --- a/tools/gdb-sd_dump_hashmaps.py +++ b/tools/gdb-sd_dump_hashmaps.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # SPDX-License-Identifier: LGPL-2.1+ from __future__ import print_function diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py index 8b85ef40f3e..8703c8a37bd 100755 --- a/tools/make-directive-index.py +++ b/tools/make-directive-index.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # SPDX-License-Identifier: LGPL-2.1+ import sys diff --git a/tools/make-man-index.py b/tools/make-man-index.py index 7ed98cb4e00..66027af02e5 100755 --- a/tools/make-man-index.py +++ b/tools/make-man-index.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # SPDX-License-Identifier: LGPL-2.1+ import collections diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py index 42a48bc98cc..c4551c6f61d 100755 --- a/tools/make-man-rules.py +++ b/tools/make-man-rules.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ -# SPDX-License-Identifier: LGPL-2.1+ +# SPDX-License-Identifier: LGPL-2.1+ from __future__ import print_function import collections diff --git a/tools/xml_helper.py b/tools/xml_helper.py index 19e343b4e3a..f399e7493ca 100755 --- a/tools/xml_helper.py +++ b/tools/xml_helper.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ -# SPDX-License-Identifier: LGPL-2.1+ +# SPDX-License-Identifier: LGPL-2.1+ from lxml import etree as tree