]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Moving scripts into bin/
authorFrank Brehm <frank@brehm-online.com>
Tue, 19 Jan 2021 22:29:17 +0000 (23:29 +0100)
committerFrank Brehm <frank@brehm-online.com>
Tue, 19 Jan 2021 22:29:17 +0000 (23:29 +0100)
bin/mk-home [new file with mode: 0755]
bin/quota-check [new file with mode: 0755]
bin/test-home [new file with mode: 0755]
mk-home [deleted file]
quota-check [deleted file]
test-home [deleted file]

diff --git a/bin/mk-home b/bin/mk-home
new file mode 100755 (executable)
index 0000000..68ceb5a
--- /dev/null
@@ -0,0 +1,68 @@
+#!/usr/bin/env python3
+
+from __future__ import print_function
+
+# Standard modules
+import sys
+import gettext
+
+__exp_py_version_major__ = 3
+__min_py_version_minor__ = 4
+
+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:
+    import pathlib
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path
+    import pathlib2 as pathlib
+
+# 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_lib')
+
+if module_dir.exists():
+    sys.path.insert(0, str(lib_dir))
+
+from pp_lib.mk_home_app import PpMkHomeApp
+
+__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
+__copyright__ = '(C) 2021 by Frank Brehm, Pixelpark GmbH, Berlin'
+
+appname = my_path.name
+
+locale.setlocale(locale.LC_ALL, '')
+
+app = PpMkHomeApp(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), file=sys.stderr)
+
+app()
+
+sys.exit(0)
+
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
diff --git a/bin/quota-check b/bin/quota-check
new file mode 100755 (executable)
index 0000000..27a817e
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+from __future__ import print_function
+
+# Standard modules
+import sys
+import os
+import logging
+import locale
+
+# own modules:
+cur_dir = os.getcwd()
+base_dir = cur_dir
+
+if sys.argv[0] != '' and sys.argv[0] != '-c':
+    cur_dir = os.path.dirname(sys.argv[0])
+if os.path.exists(os.path.join(cur_dir, 'pp_lib')):
+    sys.path.insert(0, os.path.abspath(cur_dir))
+
+from pp_lib.quota_check import PpQuotaCheckApp
+
+log = logging.getLogger(__name__)
+
+__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
+__copyright__ = '(C) 2018 by Frank Brehm, Pixelpark GmbH, Berlin'
+
+appname = os.path.basename(sys.argv[0])
+
+for loc in ('de_DE.utf8', 'en_US.UTF-8'):
+    try:
+        locale.setlocale(locale.LC_ALL, loc)
+        break
+    except locale.Error as e:
+        sys.stderr.write("Locale %r not supported: %s\n" % (loc, e))
+        continue
+
+app = PpQuotaCheckApp(appname=appname)
+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/bin/test-home b/bin/test-home
new file mode 100755 (executable)
index 0000000..15cb7f2
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+# Standard modules
+import sys
+import os
+import logging
+import locale
+
+# own modules:
+cur_dir = os.getcwd()
+base_dir = cur_dir
+
+if sys.argv[0] != '' and sys.argv[0] != '-c':
+    cur_dir = os.path.dirname(sys.argv[0])
+if os.path.exists(os.path.join(cur_dir, 'pp_lib')):
+    sys.path.insert(0, os.path.abspath(cur_dir))
+
+from pp_lib.test_home_app import PpTestHomeApp
+
+log = logging.getLogger(__name__)
+
+__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
+__copyright__ = '(C) 2018 by Frank Brehm, Pixelpark GmbH, Berlin'
+
+appname = os.path.basename(sys.argv[0])
+
+locale.setlocale(locale.LC_ALL, '')
+
+app = PpTestHomeApp(appname=appname)
+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/mk-home b/mk-home
deleted file mode 100755 (executable)
index 68ceb5a..0000000
--- a/mk-home
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python3
-
-from __future__ import print_function
-
-# Standard modules
-import sys
-import gettext
-
-__exp_py_version_major__ = 3
-__min_py_version_minor__ = 4
-
-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:
-    import pathlib
-    from pathlib import Path
-except ImportError:
-    from pathlib2 import Path
-    import pathlib2 as pathlib
-
-# 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_lib')
-
-if module_dir.exists():
-    sys.path.insert(0, str(lib_dir))
-
-from pp_lib.mk_home_app import PpMkHomeApp
-
-__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
-__copyright__ = '(C) 2021 by Frank Brehm, Pixelpark GmbH, Berlin'
-
-appname = my_path.name
-
-locale.setlocale(locale.LC_ALL, '')
-
-app = PpMkHomeApp(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), file=sys.stderr)
-
-app()
-
-sys.exit(0)
-
-# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
diff --git a/quota-check b/quota-check
deleted file mode 100755 (executable)
index 27a817e..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
-from __future__ import print_function
-
-# Standard modules
-import sys
-import os
-import logging
-import locale
-
-# own modules:
-cur_dir = os.getcwd()
-base_dir = cur_dir
-
-if sys.argv[0] != '' and sys.argv[0] != '-c':
-    cur_dir = os.path.dirname(sys.argv[0])
-if os.path.exists(os.path.join(cur_dir, 'pp_lib')):
-    sys.path.insert(0, os.path.abspath(cur_dir))
-
-from pp_lib.quota_check import PpQuotaCheckApp
-
-log = logging.getLogger(__name__)
-
-__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
-__copyright__ = '(C) 2018 by Frank Brehm, Pixelpark GmbH, Berlin'
-
-appname = os.path.basename(sys.argv[0])
-
-for loc in ('de_DE.utf8', 'en_US.UTF-8'):
-    try:
-        locale.setlocale(locale.LC_ALL, loc)
-        break
-    except locale.Error as e:
-        sys.stderr.write("Locale %r not supported: %s\n" % (loc, e))
-        continue
-
-app = PpQuotaCheckApp(appname=appname)
-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/test-home b/test-home
deleted file mode 100755 (executable)
index 15cb7f2..0000000
--- a/test-home
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python3
-
-# Standard modules
-import sys
-import os
-import logging
-import locale
-
-# own modules:
-cur_dir = os.getcwd()
-base_dir = cur_dir
-
-if sys.argv[0] != '' and sys.argv[0] != '-c':
-    cur_dir = os.path.dirname(sys.argv[0])
-if os.path.exists(os.path.join(cur_dir, 'pp_lib')):
-    sys.path.insert(0, os.path.abspath(cur_dir))
-
-from pp_lib.test_home_app import PpTestHomeApp
-
-log = logging.getLogger(__name__)
-
-__author__ = 'Frank Brehm <frank.brehm@pixelpark.com>'
-__copyright__ = '(C) 2018 by Frank Brehm, Pixelpark GmbH, Berlin'
-
-appname = os.path.basename(sys.argv[0])
-
-locale.setlocale(locale.LC_ALL, '')
-
-app = PpTestHomeApp(appname=appname)
-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