]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Adding bin/dns-deploy-zones and setup.cfg
authorFrank Brehm <frank@brehm-online.com>
Fri, 26 Nov 2021 09:01:57 +0000 (10:01 +0100)
committerFrank Brehm <frank@brehm-online.com>
Fri, 26 Nov 2021 09:01:57 +0000 (10:01 +0100)
bin/dns-deploy-zones [new file with mode: 0644]
setup.cfg [new file with mode: 0644]

diff --git a/bin/dns-deploy-zones b/bin/dns-deploy-zones
new file mode 100644 (file)
index 0000000..6d1495e
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/env python3
+
+from __future__ import print_function
+
+# Standard modules
+import sys
+
+__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(
+        __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)
+    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(
+        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)
+    sys.exit(1)
+
+# Standard modules
+import os
+import locale
+
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path
+
+# own modules:
+
+my_path = Path(__file__)
+my_real_path = my_path.resolve()
+bin_path = my_real_path.parent
+base_dir = bin_path.parent
+lib_dir = base_dir.joinpath('lib')
+module_dir = lib_dir.joinpath('pp_admintools')
+
+if module_dir.exists():
+    sys.path.insert(0, str(lib_dir))
+
+from pp_admintools.deploy_zones_from_pdns import PpDeployZonesApp
+
+__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
+__copyright__ = '(C) 2021 by Frank Brehm, Pixelpark GmbH, Berlin'
+
+appname = os.path.basename(sys.argv[0])
+
+locale.setlocale(locale.LC_ALL, '')
+
+app = PpDeployZonesApp(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))
+
+app()
+
+sys.exit(0)
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
diff --git a/setup.cfg b/setup.cfg
new file mode 100644 (file)
index 0000000..f563967
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,11 @@
+
+[pep8]
+
+max-line-length = 99
+
+[flake8]
+
+max-line-length = 99
+max-complexity = 20
+ignore = E226,E302,E41,E402
+