Skip to content

Commit

Permalink
Sanity check all apps work
Browse files Browse the repository at this point in the history
  • Loading branch information
bergercookie committed Jan 28, 2024
1 parent 363f5df commit f9af7c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
9 changes: 3 additions & 6 deletions syncall/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,6 @@ def decorator(f):
_opt_gkeep_user_pass_path,
_opt_gkeep_passwd_pass_path,
_opt_gkeep_token_pass_path,
_opt_gkeep_labels,
_opt_gkeep_ignore_labels,
_opt_gkeep_note,
]
):
f = d()(f)
Expand Down Expand Up @@ -304,7 +301,7 @@ def _opt_gkeep_token_pass_path():
)


def _opt_gkeep_labels():
def opt_gkeep_labels():
return click.option(
"-k",
"--gkeep-labels",
Expand All @@ -314,7 +311,7 @@ def _opt_gkeep_labels():
)


def _opt_gkeep_ignore_labels():
def opt_gkeep_ignore_labels():
return click.option(
"-i",
"--gkeep-ignore-labels",
Expand All @@ -324,7 +321,7 @@ def _opt_gkeep_ignore_labels():
)


def _opt_gkeep_note():
def opt_gkeep_note():
return click.option(
"-k",
"--gkeep-note",
Expand Down
6 changes: 4 additions & 2 deletions syncall/scripts/fs_gkeep_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from syncall.cli import (
opt_filename_extension,
opt_filesystem_root,
opt_gkeep_ignore_labels,
opt_gkeep_labels,
opts_gkeep,
opts_miscellaneous,
)
Expand All @@ -38,11 +40,11 @@


@click.command()
@opt_gkeep_labels()
@opt_gkeep_ignore_labels()
@opts_gkeep()
# filesystem options --------------------------------------------------------------------------
@opt_filename_extension()
@opt_filesystem_root()
# misc options --------------------------------------------------------------------------------
@opts_miscellaneous("Filesystem", "Google Keep")
def main(
filesystem_root: Optional[str],
Expand Down
21 changes: 11 additions & 10 deletions syncall/scripts/tw_asana_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def main(
asana_client = asana.Client.access_token(asana_token)
asana_disable = asana_client.headers.get("Asana-Disable", "")
asana_client.headers["Asana-Disable"] = ",".join(
[asana_client.headers.get("Asana-Disable", ""), "new_user_task_lists"]
[
asana_client.headers.get("Asana-Disable", ""),
"new_user_task_lists",
"new_goal_memberships",
]
)
asana_client.options["client_name"] = "syncall"

Expand All @@ -139,7 +143,7 @@ def main(

found_workspace = False

for workspace in asana_client.workspaces.find_all():
for workspace in asana_client.workspaces.find_all(): # type: ignore
if workspace["gid"] == asana_workspace_gid:
asana_workspace_name = workspace["name"]
found_workspace = True
Expand All @@ -154,14 +158,11 @@ def main(
asana_workspace_gid = workspace["gid"]
found_workspace = True
else:
if asana_workspace_gid:
error_and_exit(
f"No Asana workspace was found with GID {asana_workspace_gid} ."
)
if asana_workspace_name:
error_and_exit(
f"No Asana workspace was found with name {asana_workspace_name} ."
)
if not asana_workspace_gid:
li = [f"No Asana workspace was found with GID {asana_workspace_gid}"]
if asana_workspace_name:
li.append(f" | Workspace Name: {asana_workspace_name}")
error_and_exit(f"{' '.join(li)}.")

# more checks -----------------------------------------------------------------------------
combination_of_tw_related_options = any([tw_filter_li, tw_tags, tw_project])
Expand Down
4 changes: 3 additions & 1 deletion syncall/scripts/tw_gkeep_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
register_teardown_handler,
write_to_pass_manager,
)
from syncall.cli import opts_gkeep, opts_miscellaneous, opts_tw_filtering
from syncall.cli import opt_gkeep_note, opts_gkeep, opts_miscellaneous, opts_tw_filtering
from syncall.tw_gkeep_utils import convert_gkeep_todo_to_tw, convert_tw_to_gkeep_todo


@click.command()
@opts_gkeep()
@opt_gkeep_note()
@opts_tw_filtering()
@opts_miscellaneous(side_A_name="TW", side_B_name="Google Keep")
def main(
Expand All @@ -47,6 +48,7 @@ def main(
tw_project: str,
tw_only_modified_last_X_days: str,
tw_sync_all_tasks: bool,
prefer_scheduled_date: bool,
resolution_strategy: str,
verbose: int,
combination_name: str,
Expand Down

0 comments on commit f9af7c9

Please sign in to comment.