From 4c8b897e5e20200835bbfad083ca76df5cad9d24 Mon Sep 17 00:00:00 2001 From: Keith Vassallo Date: Tue, 28 May 2024 09:55:10 +0100 Subject: [PATCH] Added install script for TaskBridge CLI. --- poetry.lock | 38 ++++++++++++++++++++------------------ pyproject.toml | 3 +++ taskbridge/cli/tbcli.py | 11 ++++++++--- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/poetry.lock b/poetry.lock index 58f7a07..f271992 100644 --- a/poetry.lock +++ b/poetry.lock @@ -991,19 +991,20 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "py2app" -version = "0.28.7" +version = "0.28.8" description = "Create standalone Mac OS X applications with Python" optional = false python-versions = "*" files = [ - {file = "py2app-0.28.7-py2.py3-none-any.whl", hash = "sha256:7e802adc3e5dcf0621c01272b56a56e177c59b28b4b5c989537e37fd77f3a660"}, - {file = "py2app-0.28.7.tar.gz", hash = "sha256:6d74a97b0f0ec92999b6251a255ae37a18d0ae89939e72dbb6d9d7dae06a5e10"}, + {file = "py2app-0.28.8-py2.py3-none-any.whl", hash = "sha256:38b80f0c91f8d2dddb6396e6bbff8a84875f073c510f4f1a307e8ae44c7d73d8"}, + {file = "py2app-0.28.8.tar.gz", hash = "sha256:cab7aec752a8b83e7c6cef7c15271dc720155275e44cbf610e3162e0807313ec"}, ] [package.dependencies] altgraph = ">=0.17.3" macholib = ">=1.16.2" modulegraph = ">=0.19.6" +packaging = "*" [[package]] name = "pycodestyle" @@ -1260,13 +1261,13 @@ x-wr-timezone = ">=0.0.5,<1.0.0" [[package]] name = "requests" -version = "2.32.1" +version = "2.32.2" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" files = [ - {file = "requests-2.32.1-py3-none-any.whl", hash = "sha256:21ac9465cdf8c1650fe1ecde8a71669a93d4e6f147550483a2967d08396a56a5"}, - {file = "requests-2.32.1.tar.gz", hash = "sha256:eb97e87e64c79e64e5b8ac75cee9dd1f97f49e289b083ee6be96268930725685"}, + {file = "requests-2.32.2-py3-none-any.whl", hash = "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c"}, + {file = "requests-2.32.2.tar.gz", hash = "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289"}, ] [package.dependencies] @@ -1281,15 +1282,17 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "schedule" -version = "1.2.1" +version = "1.2.2" description = "Job scheduling for humans." optional = false python-versions = ">=3.7" files = [ - {file = "schedule-1.2.1-py2.py3-none-any.whl", hash = "sha256:14cdeb083a596aa1de6dc77639a1b2ac8bf6eaafa82b1c9279d3612823063d01"}, - {file = "schedule-1.2.1.tar.gz", hash = "sha256:843bc0538b99c93f02b8b50e3e39886c06f2d003b24f48e1aa4cadfa3f341279"}, + {file = "schedule-1.2.2-py3-none-any.whl", hash = "sha256:5bef4a2a0183abf44046ae0d164cadcac21b1db011bdd8102e4a0c1e91e06a7d"}, ] +[package.extras] +timezone = ["pytz"] + [[package]] name = "secretstorage" version = "3.3.3" @@ -1307,19 +1310,18 @@ jeepney = ">=0.6" [[package]] name = "setuptools" -version = "69.5.1" +version = "70.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-69.5.1-py3-none-any.whl", hash = "sha256:c636ac361bc47580504644275c9ad802c50415c7522212252c033bd15f301f32"}, - {file = "setuptools-69.5.1.tar.gz", hash = "sha256:6c1fccdac05a97e598fb0ae3bbed5904ccb317337a51139dcd51453611bbb987"}, + {file = "setuptools-70.0.0-py3-none-any.whl", hash = "sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4"}, + {file = "setuptools-70.0.0.tar.gz", hash = "sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "six" @@ -1636,13 +1638,13 @@ pytz = "*" [[package]] name = "zipp" -version = "3.18.2" +version = "3.19.0" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.18.2-py3-none-any.whl", hash = "sha256:dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e"}, - {file = "zipp-3.18.2.tar.gz", hash = "sha256:6278d9ddbcfb1f1089a88fde84481528b07b0e10474e09dcfe53dad4069fa059"}, + {file = "zipp-3.19.0-py3-none-any.whl", hash = "sha256:96dc6ad62f1441bcaccef23b274ec471518daf4fbbc580341204936a5a3dddec"}, + {file = "zipp-3.19.0.tar.gz", hash = "sha256:952df858fb3164426c976d9338d3961e8e8b3758e2e059e0f754b8c4262625ee"}, ] [package.extras] diff --git a/pyproject.toml b/pyproject.toml index fcb8959..ab2161d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,9 @@ name = "TaskBridge" script = "taskbridge/gui/app.py" build-type = "standalone" +[tool.poetry.scripts] +tbcli = 'taskbridge.cli.tbcli:main' + [tool.coverage.run] omit = [ "*tests*", diff --git a/taskbridge/cli/tbcli.py b/taskbridge/cli/tbcli.py index 51987fb..9174a88 100644 --- a/taskbridge/cli/tbcli.py +++ b/taskbridge/cli/tbcli.py @@ -86,7 +86,7 @@ def preflight_notes() -> bool: if len(associations['bi_directional']) == 0 and len(associations['local_to_remote']) == 0 and len( associations['remote_to_local']) == 0: logging.critical("No folders set for synchronisation." + - "Use --notes-bi-directional, --notes-local-to-remote, --notes-remote-to-local to specify or" + + "Use --notes-bi-directional, --notes-local-to-remote, --notes-remote-to-local to specify or " + "add an associations object in configuration file.") sys.exit(13) return True @@ -279,7 +279,7 @@ def apply_settings(self) -> None: """ # Load settings from file - if self.args.config: + if 'config' in self.args: # Load settings from custom configuration file if os.path.exists(self.args.config): conf_file = self.args.config @@ -377,7 +377,7 @@ def setup_logging(self) -> logging.Logger: return logging.getLogger() -if __name__ == "__main__": +def main(): parser = argparse.ArgumentParser( prog="TaskBridge CLI", description="Export your Apple Reminders & Notes to NextCloud, a local folder, or CalDav - and keep them in sync!", @@ -467,3 +467,8 @@ def setup_logging(self) -> logging.Logger: help="specify the logging level.") tb_cli = TaskBridgeCli(parser.parse_args()) + + +if __name__ == "__main__": + main() +