From: Frank Brehm Date: Tue, 16 May 2023 16:46:24 +0000 (+0200) Subject: Adding bin/barracuda-sync X-Git-Tag: 0.9.0~1^2~51 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=310a0f0b034a10b2aa81f77f1a05815617e1d32c;p=pixelpark%2Fpp-admin-tools.git Adding bin/barracuda-sync --- diff --git a/bin/barracuda-sync b/bin/barracuda-sync new file mode 100755 index 0000000..7812d01 --- /dev/null +++ b/bin/barracuda-sync @@ -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 + +__author__ = 'Frank Brehm ' +__copyright__ = '(C) 2023 by Frank Brehm, Digitas Pixelpark GmbH, Berlin' + +# 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.app.barracuda_sync import BarracudaSyncApp + +appname = os.path.basename(sys.argv[0]) + +locale.setlocale(locale.LC_ALL, '') + +app = BarracudaSyncApp(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