From f5b0a4f272009cd0a41dfe87831383aa648fea57 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Sun, 7 Feb 2021 14:09:57 +0100 Subject: [PATCH] fixed python packaging --- setup.py | 4 ++-- zfs_autobackup/ZfsAutobackup.py | 4 ++-- zfs_autobackup/__init__.py | 7 +++++++ zfs_autobackup/__main__.py | 5 ++--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 27dc6e9..424d50b 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import setuptools -import zfs_autobackup +from zfs_autobackup.ZfsAutobackup import ZfsAutobackup import os with open("README.md", "r") as fh: @@ -7,7 +7,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="zfs_autobackup", - version=zfs_autobackup.VERSION, + version=ZfsAutobackup.VERSION, author="Edwin Eefting", author_email="edwin@datux.nl", description="ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. It tries to be the most friendly to use and easy to debug ZFS backup tool.", diff --git a/zfs_autobackup/ZfsAutobackup.py b/zfs_autobackup/ZfsAutobackup.py index e1bb0fa..5739230 100644 --- a/zfs_autobackup/ZfsAutobackup.py +++ b/zfs_autobackup/ZfsAutobackup.py @@ -111,8 +111,8 @@ class ZfsAutobackup: self.args = args #auto enable progress? - # if sys.stderr.isatty() and not args.no_progress: - # args.progress = True + if sys.stderr.isatty() and not args.no_progress: + args.progress = True if args.debug_output: args.debug = True diff --git a/zfs_autobackup/__init__.py b/zfs_autobackup/__init__.py index e69de29..644d3bc 100755 --- a/zfs_autobackup/__init__.py +++ b/zfs_autobackup/__init__.py @@ -0,0 +1,7 @@ + +def cli(): + import sys + from zfs_autobackup.ZfsAutobackup import ZfsAutobackup + + zfs_autobackup = ZfsAutobackup(sys.argv[1:], False) + sys.exit(zfs_autobackup.run()) diff --git a/zfs_autobackup/__main__.py b/zfs_autobackup/__main__.py index d0801f5..5912928 100755 --- a/zfs_autobackup/__main__.py +++ b/zfs_autobackup/__main__.py @@ -5,7 +5,6 @@ import sys if __name__ == "__main__": - from zfs_autobackup.ZfsAutobackup import ZfsAutobackup - zfs_autobackup = ZfsAutobackup(sys.argv[1:], False) - sys.exit(zfs_autobackup.run()) + from . import cli + cli()