From f197acf8e00d20db25f267604685898dc0547daa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 27 Sep 2021 17:27:42 +0200 Subject: [PATCH] CI: add stubs for libcalamares bits, to help pylint --- ci/libcalamares/__init__.py | 9 +++++++++ ci/libcalamares/globalstorage.py | 9 +++++++++ ci/libcalamares/utils.py | 15 +++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 ci/libcalamares/__init__.py create mode 100644 ci/libcalamares/globalstorage.py create mode 100644 ci/libcalamares/utils.py diff --git a/ci/libcalamares/__init__.py b/ci/libcalamares/__init__.py new file mode 100644 index 000000000..11bf0ffe2 --- /dev/null +++ b/ci/libcalamares/__init__.py @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Stubs for part of the Python API from libcalamares +# (although the **actual** API is presented through +# Boost::Python, not as a bare C-extension) so that +# pylint doesn't complain about libcalamares internals. + +pass diff --git a/ci/libcalamares/globalstorage.py b/ci/libcalamares/globalstorage.py new file mode 100644 index 000000000..3c2acb870 --- /dev/null +++ b/ci/libcalamares/globalstorage.py @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Stubs for part of the Python API from libcalamares +# (although the **actual** API is presented through +# Boost::Python, not as a bare C-extension) so that +# pylint doesn't complain about libcalamares internals. + +def value(_): return 1 diff --git a/ci/libcalamares/utils.py b/ci/libcalamares/utils.py new file mode 100644 index 000000000..1d423893b --- /dev/null +++ b/ci/libcalamares/utils.py @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Stubs for part of the Python API from libcalamares +# (although the **actual** API is presented through +# Boost::Python, not as a bare C-extension) so that +# pylint doesn't complain about libcalamares internals. + +def debug(_): pass + +def warning(_): pass + +def gettext_path(): pass + +def gettext_languages(): pass