Skip to content

Commit

Permalink
Added install script for TaskBridge CLI.
Browse files Browse the repository at this point in the history
  • Loading branch information
pint-sized committed May 28, 2024
1 parent 0ca7b1a commit 4c8b897
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
38 changes: 20 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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*",
Expand Down
11 changes: 8 additions & 3 deletions taskbridge/cli/tbcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!",
Expand Down Expand Up @@ -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()

0 comments on commit 4c8b897

Please sign in to comment.