From 948fc5f7776e04f54d18c166b20b9a86f524ac67 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 13 Apr 2021 18:45:05 +1000 Subject: [PATCH] add missing copyright headers to *.py --- cargo/update.py | 2 ++ ftl/duplicate-string.py | 4 +++- ftl/extract-strings.py | 3 ++- ftl/format.py | 3 ++- ftl/format_check.py | 3 +++ ftl/sync.py | 2 ++ ftl/transform-string.py | 3 ++- pip/update.py | 3 +++ pylib/anki/types.py | 3 +++ pylib/tests/run_format.py | 3 +++ pylib/tests/run_mypy.py | 3 +++ pylib/tests/run_pylint.py | 3 +++ pylib/tests/run_pytest.py | 3 +++ pylib/tests/shared.py | 3 +++ pylib/tests/test_cards.py | 3 +++ pylib/tests/test_collection.py | 3 +++ pylib/tests/test_decks.py | 3 +++ pylib/tests/test_exporting.py | 3 +++ pylib/tests/test_find.py | 3 +++ pylib/tests/test_flags.py | 3 +++ pylib/tests/test_importing.py | 3 +++ pylib/tests/test_latex.py | 3 +++ pylib/tests/test_media.py | 3 +++ pylib/tests/test_models.py | 3 +++ pylib/tests/test_schedv1.py | 3 ++- pylib/tests/test_schedv2.py | 3 ++- pylib/tests/test_stats.py | 4 ++-- pylib/tests/test_template.py | 3 +++ pylib/tests/test_undo.py | 3 ++- pylib/tools/diff-sched.py | 3 +++ pylib/tools/genhooks.py | 3 +++ pylib/tools/protoc_wrapper.py | 2 ++ qt/aqt/reviewer.py | 1 + qt/aqt/tts.py | 3 +++ qt/bazelfixes.py | 5 ++++ qt/runanki.py | 3 +++ qt/tests/run_format.py | 3 +++ qt/tests/run_mypy.py | 3 +++ qt/tests/run_pylint.py | 3 +++ qt/tests/run_pytest.py | 3 +++ qt/tests/test_addons.py | 3 +++ qt/tests/test_i18n.py | 3 +++ qt/tools/extract_sass_colors.py | 9 +++++-- qt/tools/genhooks_gui.py | 3 +++ qt/tools/profile.py | 3 +++ scripts/buildinfo.py | 4 ++++ scripts/copyright_headers.py | 42 +++++++++++++++++++++++++++++++++ 47 files changed, 175 insertions(+), 11 deletions(-) create mode 100644 scripts/copyright_headers.py diff --git a/cargo/update.py b/cargo/update.py index d8e60ed18..970c5dc96 100755 --- a/cargo/update.py +++ b/cargo/update.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # # See README.md diff --git a/ftl/duplicate-string.py b/ftl/duplicate-string.py index 9f44d8b7a..fbe1e1882 100644 --- a/ftl/duplicate-string.py +++ b/ftl/duplicate-string.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 -# -*- coding: UTF-8 -*- +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import json import re diff --git a/ftl/extract-strings.py b/ftl/extract-strings.py index 0163e6547..bd8c108a6 100644 --- a/ftl/extract-strings.py +++ b/ftl/extract-strings.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -# -*- coding: UTF-8 -*- +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ Tool to extract core strings and keys from .ftl files. diff --git a/ftl/format.py b/ftl/format.py index 1695dfa38..e398616fd 100644 --- a/ftl/format.py +++ b/ftl/format.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -# -*- coding: UTF-8 -*- +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ Parse and re-serialize ftl files to get them in a consistent form. diff --git a/ftl/format_check.py b/ftl/format_check.py index 9df5ed058..5abbcf32f 100644 --- a/ftl/format_check.py +++ b/ftl/format_check.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import format import sys diff --git a/ftl/sync.py b/ftl/sync.py index 0f27ec3f4..daf286a17 100644 --- a/ftl/sync.py +++ b/ftl/sync.py @@ -1,3 +1,5 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # # A helper script to update commit references to the latest translations, # and copy source files to the translation repos. Requires access to the diff --git a/ftl/transform-string.py b/ftl/transform-string.py index 3e9f0c309..4a92944e4 100644 --- a/ftl/transform-string.py +++ b/ftl/transform-string.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -# -*- coding: UTF-8 -*- +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ Tool to apply transform to an ftl string and its translations. diff --git a/pip/update.py b/pip/update.py index a74e710ec..69f586a03 100644 --- a/pip/update.py +++ b/pip/update.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import sys import os import click diff --git a/pylib/anki/types.py b/pylib/anki/types.py index 210a62c74..d6f1406a2 100644 --- a/pylib/anki/types.py +++ b/pylib/anki/types.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + from typing import NoReturn diff --git a/pylib/tests/run_format.py b/pylib/tests/run_format.py index 9ea686bd9..8bc386995 100644 --- a/pylib/tests/run_format.py +++ b/pylib/tests/run_format.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import subprocess import sys diff --git a/pylib/tests/run_mypy.py b/pylib/tests/run_mypy.py index 2cc7a20c9..fc99a47e2 100644 --- a/pylib/tests/run_mypy.py +++ b/pylib/tests/run_mypy.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import subprocess import sys diff --git a/pylib/tests/run_pylint.py b/pylib/tests/run_pylint.py index 6a3e3bc81..38cff00f8 100644 --- a/pylib/tests/run_pylint.py +++ b/pylib/tests/run_pylint.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import subprocess import sys diff --git a/pylib/tests/run_pytest.py b/pylib/tests/run_pytest.py index 6489ec747..f4b6d75b7 100644 --- a/pylib/tests/run_pytest.py +++ b/pylib/tests/run_pytest.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import sys diff --git a/pylib/tests/shared.py b/pylib/tests/shared.py index e988dfc6d..b64599329 100644 --- a/pylib/tests/shared.py +++ b/pylib/tests/shared.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import shutil import tempfile diff --git a/pylib/tests/test_cards.py b/pylib/tests/test_cards.py index 1b1e428d8..907450c98 100644 --- a/pylib/tests/test_cards.py +++ b/pylib/tests/test_cards.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 from tests.shared import getEmptyCol diff --git a/pylib/tests/test_collection.py b/pylib/tests/test_collection.py index 90a2c462e..95b941708 100644 --- a/pylib/tests/test_collection.py +++ b/pylib/tests/test_collection.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import os diff --git a/pylib/tests/test_decks.py b/pylib/tests/test_decks.py index 82e0dffcf..297a63bad 100644 --- a/pylib/tests/test_decks.py +++ b/pylib/tests/test_decks.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 from anki.errors import DeckRenameError diff --git a/pylib/tests/test_exporting.py b/pylib/tests/test_exporting.py index f7dae2118..d5659c921 100644 --- a/pylib/tests/test_exporting.py +++ b/pylib/tests/test_exporting.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import os diff --git a/pylib/tests/test_find.py b/pylib/tests/test_find.py index 56ada7e5f..274bad872 100644 --- a/pylib/tests/test_find.py +++ b/pylib/tests/test_find.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import pytest diff --git a/pylib/tests/test_flags.py b/pylib/tests/test_flags.py index 3cb85be6f..bd0d44c88 100644 --- a/pylib/tests/test_flags.py +++ b/pylib/tests/test_flags.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + from tests.shared import getEmptyCol diff --git a/pylib/tests/test_importing.py b/pylib/tests/test_importing.py index 6c8bcd022..129c2413d 100644 --- a/pylib/tests/test_importing.py +++ b/pylib/tests/test_importing.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import os diff --git a/pylib/tests/test_latex.py b/pylib/tests/test_latex.py index 59f8b50ae..879df5b2c 100644 --- a/pylib/tests/test_latex.py +++ b/pylib/tests/test_latex.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import os diff --git a/pylib/tests/test_media.py b/pylib/tests/test_media.py index 49ac74d24..30e2b8056 100644 --- a/pylib/tests/test_media.py +++ b/pylib/tests/test_media.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import os diff --git a/pylib/tests/test_models.py b/pylib/tests/test_models.py index b0d584f6f..a5f947d88 100644 --- a/pylib/tests/test_models.py +++ b/pylib/tests/test_models.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # coding: utf-8 import time diff --git a/pylib/tests/test_schedv1.py b/pylib/tests/test_schedv1.py index c1a4d3c89..377ac7710 100644 --- a/pylib/tests/test_schedv1.py +++ b/pylib/tests/test_schedv1.py @@ -1,4 +1,5 @@ -# coding: utf-8 +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import copy import time diff --git a/pylib/tests/test_schedv2.py b/pylib/tests/test_schedv2.py index be7518f10..cf56062fe 100644 --- a/pylib/tests/test_schedv2.py +++ b/pylib/tests/test_schedv2.py @@ -1,4 +1,5 @@ -# coding: utf-8 +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import copy import os diff --git a/pylib/tests/test_stats.py b/pylib/tests/test_stats.py index 101bd50ed..c79777044 100644 --- a/pylib/tests/test_stats.py +++ b/pylib/tests/test_stats.py @@ -1,5 +1,5 @@ -#!/usr/bin/env python3 -# -*- coding: UTF-8 -*- +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import os import tempfile diff --git a/pylib/tests/test_template.py b/pylib/tests/test_template.py index bd3234d6f..9af10c625 100644 --- a/pylib/tests/test_template.py +++ b/pylib/tests/test_template.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + from tests.shared import getEmptyCol diff --git a/pylib/tests/test_undo.py b/pylib/tests/test_undo.py index 094c198df..9bef9190a 100644 --- a/pylib/tests/test_undo.py +++ b/pylib/tests/test_undo.py @@ -1,4 +1,5 @@ -# coding: utf-8 +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import time diff --git a/pylib/tools/diff-sched.py b/pylib/tools/diff-sched.py index d64708924..e1e2d90cd 100644 --- a/pylib/tools/diff-sched.py +++ b/pylib/tools/diff-sched.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # a quick script to compare methods in the two schedulers import inspect diff --git a/pylib/tools/genhooks.py b/pylib/tools/genhooks.py index 9c43c5f94..6bfce8a31 100644 --- a/pylib/tools/genhooks.py +++ b/pylib/tools/genhooks.py @@ -112,6 +112,9 @@ hooks = [ ] prefix = """\ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # This file is automatically generated; edit tools/genhooks.py instead. # Please import from anki.hooks instead of this file. diff --git a/pylib/tools/protoc_wrapper.py b/pylib/tools/protoc_wrapper.py index 0c4b23dd8..a7a86fcfd 100644 --- a/pylib/tools/protoc_wrapper.py +++ b/pylib/tools/protoc_wrapper.py @@ -1,4 +1,6 @@ #!/usr/bin/env +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # # Wrapper for protoc that strips the dirname from the output files, # and generates mypy typechecking info. diff --git a/qt/aqt/reviewer.py b/qt/aqt/reviewer.py index 0394bc8fd..e7d5cc525 100644 --- a/qt/aqt/reviewer.py +++ b/qt/aqt/reviewer.py @@ -1,5 +1,6 @@ # Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + from __future__ import annotations import difflib diff --git a/qt/aqt/tts.py b/qt/aqt/tts.py index 2088f639e..f0973e7be 100644 --- a/qt/aqt/tts.py +++ b/qt/aqt/tts.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + """ Basic text to speech support. diff --git a/qt/bazelfixes.py b/qt/bazelfixes.py index d7ba9bf57..6d0430abc 100644 --- a/qt/bazelfixes.py +++ b/qt/bazelfixes.py @@ -1,6 +1,10 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import sys + def fix_pywin32_in_bazel(force=False): if sys.platform != "win32": return @@ -15,6 +19,7 @@ def fix_pywin32_in_bazel(force=False): # trigger pywin32 bootstrap import site + site.addsitedir(path) # sys.path has been extended; use final diff --git a/qt/runanki.py b/qt/runanki.py index d57d85dca..6c79c8ff4 100644 --- a/qt/runanki.py +++ b/qt/runanki.py @@ -1,7 +1,10 @@ #!/usr/bin/env python3 +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import os import sys + try: import bazelfixes diff --git a/qt/tests/run_format.py b/qt/tests/run_format.py index 0a7cba933..622dd4399 100644 --- a/qt/tests/run_format.py +++ b/qt/tests/run_format.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import subprocess import sys diff --git a/qt/tests/run_mypy.py b/qt/tests/run_mypy.py index 0db40fc10..f5afcf7d4 100644 --- a/qt/tests/run_mypy.py +++ b/qt/tests/run_mypy.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import subprocess import sys diff --git a/qt/tests/run_pylint.py b/qt/tests/run_pylint.py index bec5b8cae..f05dc050d 100644 --- a/qt/tests/run_pylint.py +++ b/qt/tests/run_pylint.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import multiprocessing import os import subprocess diff --git a/qt/tests/run_pytest.py b/qt/tests/run_pytest.py index 1a2613e5b..30cfea8d3 100644 --- a/qt/tests/run_pytest.py +++ b/qt/tests/run_pytest.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import sys diff --git a/qt/tests/test_addons.py b/qt/tests/test_addons.py index 2b161df7b..366ce22ff 100644 --- a/qt/tests/test_addons.py +++ b/qt/tests/test_addons.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os.path from tempfile import TemporaryDirectory from zipfile import ZipFile diff --git a/qt/tests/test_i18n.py b/qt/tests/test_i18n.py index 008a1b55f..5c083fe0d 100644 --- a/qt/tests/test_i18n.py +++ b/qt/tests/test_i18n.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import anki.lang diff --git a/qt/tools/extract_sass_colors.py b/qt/tools/extract_sass_colors.py index 6a0c40667..9ac50a7b7 100644 --- a/qt/tools/extract_sass_colors.py +++ b/qt/tools/extract_sass_colors.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -# -*- coding: UTF-8 -*- +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import json import re @@ -31,7 +32,11 @@ for line in open(input_scss): colors.setdefault(var, []).append(val) with open(output_py, "w") as buf: + buf.write("""\ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +""") buf.write("# this file is auto-generated from _vars.scss\n") for color, (day, night) in colors.items(): color = color.replace("-", "_").upper() - buf.write(f"{color} = (\"{day}\", \"{night}\")\n") + buf.write(f'{color} = ("{day}", "{night}")\n') diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 19d7a62f0..b7d2143bc 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -11,6 +11,9 @@ import sys from hookslib import Hook, write_file prefix = """\ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + # This file is automatically generated; edit tools/genhooks_gui.py instead. # Please import from anki.hooks instead of this file. diff --git a/qt/tools/profile.py b/qt/tools/profile.py index b60686f0c..6adf0240a 100755 --- a/qt/tools/profile.py +++ b/qt/tools/profile.py @@ -1,3 +1,6 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + import os import sys diff --git a/scripts/buildinfo.py b/scripts/buildinfo.py index be8105042..c1252dffa 100644 --- a/scripts/buildinfo.py +++ b/scripts/buildinfo.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import re import sys @@ -9,10 +11,12 @@ release_mode = sys.argv[3] == "release" version_re = re.compile('anki_version = "(.*)"') + def output(text: str) -> None: "Add text with a '\n' to stdout; avoiding a '\r' on Windows" sys.stdout.buffer.write(text.encode("utf8") + b"\n") + # extract version number from defs.bzl for line in open(defs_file).readlines(): if ver := version_re.match(line): diff --git a/scripts/copyright_headers.py b/scripts/copyright_headers.py new file mode 100644 index 000000000..570775362 --- /dev/null +++ b/scripts/copyright_headers.py @@ -0,0 +1,42 @@ +# Copyright: Ankitects Pty Ltd and contributors +# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + +import os, sys +from pathlib import Path + +nonstandard_header = { + "pip/pyqt5/install_pyqt5.py", + "pylib/anki/importing/pauker.py", + "pylib/anki/importing/supermemo_xml.py", + "pylib/anki/statsbg.py", + "pylib/tools/protoc-gen-mypy.py", + "qt/aqt/mpv.py", + "qt/aqt/winpaths.py", +} + +if not os.path.exists("WORKSPACE"): + print("run from workspace root") + sys.exit(1) + +found = False +for dirpath, dirnames, fnames in os.walk("."): + dir = Path(dirpath) + if "bazel-" in dirpath: + continue + if "qt/forms" in dirpath: + continue + for fname in fnames: + if fname.endswith(".py"): + path = dir / fname + with open(path) as f: + top = f.read(256) + if not top.strip(): + continue + if str(path) in nonstandard_header: + continue + if "Ankitects Pty Ltd and contributors" not in top: + print("missing standard copyright header:", path) + found = True + +if found: + sys.exit(1) \ No newline at end of file