From: Frank Brehm Date: Tue, 6 Feb 2024 09:17:35 +0000 (+0100) Subject: Make the linter happy X-Git-Tag: 1.0.0~1^2~4 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=adc0e25dbfd5fb4f168e571b99406d5fb7dab669;p=pixelpark%2Fpp-admin-tools.git Make the linter happy --- diff --git a/bin/eval-duplicate-ldap-attributes b/bin/eval-duplicate-ldap-attributes index 7f33b17..8dbbe16 100755 --- a/bin/eval-duplicate-ldap-attributes +++ b/bin/eval-duplicate-ldap-attributes @@ -1,36 +1,40 @@ #!/usr/bin/env python3 +""" +@summary: An application module for evaluating duplicate attributes, which should be unique. +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2023 by Frank Brehm, Berlin +""" from __future__ import print_function # Standard modules +import locale +import os import sys +try: + from pathlib import Path +except ImportError: + from pathlib2 import Path + __exp_py_version_major__ = 3 __min_py_version_minor__ = 6 if sys.version_info[0] != __exp_py_version_major__: - print("This script is intended to use with Python {}.".format( + print('This script is intended to use with Python {}.'.format( __exp_py_version_major__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) if sys.version_info[1] < __min_py_version_minor__: - print("A minimal Python version of {maj}.{min} is necessary to execute this script.".format( + print('A minimal Python version of {maj}.{min} is necessary to execute this script.'.format( maj=__exp_py_version_major__, min=__min_py_version_minor__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) -# Standard modules -import os -import locale - -try: - from pathlib import Path -except ImportError: - from pathlib2 import Path - __author__ = 'Frank Brehm ' __copyright__ = '(C) 2023 by Frank Brehm, Digitas Pixelpark GmbH, Berlin' @@ -56,7 +60,7 @@ app = EvalDuplicateAttribsApplication(appname=appname, base_dir=base_dir) app.initialized = True if app.verbose > 2: - print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app)) + print('{c}-Object:\n{a}'.format(c=app.__class__.__name__, a=app)) app() diff --git a/bin/mirror-ldap-instance b/bin/mirror-ldap-instance index de58d7e..a2d4c46 100755 --- a/bin/mirror-ldap-instance +++ b/bin/mirror-ldap-instance @@ -1,36 +1,40 @@ #!/usr/bin/env python3 +""" +@summary: An application module for mirroring one LDAP instance to another. +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2023 by Frank Brehm, Berlin +""" from __future__ import print_function # Standard modules +import locale +import os import sys +try: + from pathlib import Path +except ImportError: + from pathlib2 import Path + __exp_py_version_major__ = 3 __min_py_version_minor__ = 6 if sys.version_info[0] != __exp_py_version_major__: - print("This script is intended to use with Python {}.".format( + print('This script is intended to use with Python {}.'.format( __exp_py_version_major__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) if sys.version_info[1] < __min_py_version_minor__: - print("A minimal Python version of {maj}.{min} is necessary to execute this script.".format( + print('A minimal Python version of {maj}.{min} is necessary to execute this script.'.format( maj=__exp_py_version_major__, min=__min_py_version_minor__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) -# Standard modules -import os -import locale - -try: - from pathlib import Path -except ImportError: - from pathlib2 import Path - __author__ = 'Frank Brehm ' __copyright__ = '(C) 2023 by Frank Brehm, Digitas Pixelpark GmbH, Berlin' @@ -56,7 +60,7 @@ app = MirrorLdapApplication(appname=appname, base_dir=base_dir) app.initialized = True if app.verbose > 2: - print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app)) + print('{c}-Object:\n{a}'.format(c=app.__class__.__name__, a=app)) app() diff --git a/bin/mkldappasswd b/bin/mkldappasswd index 816823b..7cb0152 100755 --- a/bin/mkldappasswd +++ b/bin/mkldappasswd @@ -1,36 +1,40 @@ #!/usr/bin/env python3 +""" +@summary: An application module for the mkldappasswd application. +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2023 by Frank Brehm, Berlin +""" from __future__ import print_function # Standard modules +import locale +import os import sys +try: + from pathlib import Path +except ImportError: + from pathlib2 import Path + __exp_py_version_major__ = 3 __min_py_version_minor__ = 6 if sys.version_info[0] != __exp_py_version_major__: - print("This script is intended to use with Python {}.".format( + print('This script is intended to use with Python {}.'.format( __exp_py_version_major__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) if sys.version_info[1] < __min_py_version_minor__: - print("A minimal Python version of {maj}.{min} is necessary to execute this script.".format( + print('A minimal Python version of {maj}.{min} is necessary to execute this script.'.format( maj=__exp_py_version_major__, min=__min_py_version_minor__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) -# Standard modules -import os -import locale - -try: - from pathlib import Path -except ImportError: - from pathlib2 import Path - __author__ = 'Frank Brehm ' __copyright__ = '(C) 2023 by Frank Brehm, Digitas Pixelpark GmbH, Berlin' @@ -56,7 +60,7 @@ app = MkLdapPasswdApplication(appname=appname, base_dir=base_dir) app.initialized = True if app.verbose > 2: - print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app)) + print('{c}-Object:\n{a}'.format(c=app.__class__.__name__, a=app)) app() diff --git a/bin/remove-ldap-user b/bin/remove-ldap-user index 9bc4749..243a39c 100755 --- a/bin/remove-ldap-user +++ b/bin/remove-ldap-user @@ -1,36 +1,40 @@ #!/usr/bin/env python3 +""" +@summary: An application module for disabling or removing a user from LDAP. +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2023 by Frank Brehm, Berlin +""" from __future__ import print_function # Standard modules +import locale +import os import sys +try: + from pathlib import Path +except ImportError: + from pathlib2 import Path + __exp_py_version_major__ = 3 __min_py_version_minor__ = 6 if sys.version_info[0] != __exp_py_version_major__: - print("This script is intended to use with Python {}.".format( + print('This script is intended to use with Python {}.'.format( __exp_py_version_major__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) if sys.version_info[1] < __min_py_version_minor__: - print("A minimal Python version of {maj}.{min} is necessary to execute this script.".format( + print('A minimal Python version of {maj}.{min} is necessary to execute this script.'.format( maj=__exp_py_version_major__, min=__min_py_version_minor__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) -# Standard modules -import os -import locale - -try: - from pathlib import Path -except ImportError: - from pathlib2 import Path - __author__ = 'Frank Brehm ' __copyright__ = '(C) 2023 by Frank Brehm, Digitas Pixelpark GmbH, Berlin' @@ -56,7 +60,7 @@ app = RemoveLdapUserApplication(appname=appname, base_dir=base_dir) app.initialized = True if app.verbose > 2: - print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app)) + print('{c}-Object:\n{a}'.format(c=app.__class__.__name__, a=app)) app() diff --git a/bin/set-ldap-password b/bin/set-ldap-password index b4becc5..78bf46f 100755 --- a/bin/set-ldap-password +++ b/bin/set-ldap-password @@ -1,36 +1,40 @@ #!/usr/bin/env python3 +""" +@summary: An application module for setting a LDAP password. +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2023 by Frank Brehm, Berlin +""" from __future__ import print_function # Standard modules +import locale +import os import sys +try: + from pathlib import Path +except ImportError: + from pathlib2 import Path + __exp_py_version_major__ = 3 __min_py_version_minor__ = 6 if sys.version_info[0] != __exp_py_version_major__: - print("This script is intended to use with Python {}.".format( + print('This script is intended to use with Python {}.'.format( __exp_py_version_major__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) if sys.version_info[1] < __min_py_version_minor__: - print("A minimal Python version of {maj}.{min} is necessary to execute this script.".format( + print('A minimal Python version of {maj}.{min} is necessary to execute this script.'.format( maj=__exp_py_version_major__, min=__min_py_version_minor__), file=sys.stderr) - print("You are using Python: {0}.{1}.{2}-{3}-{4}.".format( - *sys.version_info) + "\n", file=sys.stderr) + print('You are using Python: {0}.{1}.{2}-{3}-{4}.'.format( + *sys.version_info) + '\n', file=sys.stderr) sys.exit(1) -# Standard modules -import os -import locale - -try: - from pathlib import Path -except ImportError: - from pathlib2 import Path - __author__ = 'Frank Brehm ' __copyright__ = '(C) 2023 by Frank Brehm, Digitas Pixelpark GmbH, Berlin' @@ -56,7 +60,7 @@ app = SetLdapPasswordApplication(appname=appname, base_dir=base_dir) app.initialized = True if app.verbose > 2: - print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app)) + print('{c}-Object:\n{a}'.format(c=app.__class__.__name__, a=app)) app()