-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable custom TW filters + virtual tags
* For apps that interact with Taskwarrior there's a `-f`/`--tw-filter` option to specify a custom TW filter - exactly the same way as you'd specify it in the command line. ```sh tw_gtasks_sync -l kalivradia -t kalimera -f "+OVERDUE description.startswith:somestring" ``` * For debugging purposes introduce a --pdb-on-error flag to assist debugging the end-user applications * Resturcture the command line parameters of the end-user apps Instead of passing each one of the arguments via a dedicated separators apps now use bundles of CLI params. Example: Before: ````python @click.command() @opt_gkeep_labels() @opt_gkeep_passwd_pass_path() @opt_gkeep_token_pass_path() @opt_gkeep_user_pass_path() main( ... ) ``` After: ```python @click.command() opts_gkeep() main( ...) ``` Mark the specific cli.py::opt_ click decorators as internal * tw: Use taskw_ng 0.2.1 and switch to taskw_ng package name * Remove top-level __init__.py global imports. It was an extra effort maintaining them and there wasn't much of value * Fix bug when combination filename contains a dot - allow config filenames such as `kalivradia__+OVERDUE%20description.startswith%3AE__None__kalimera.yaml` This commit also includes: * Format generate-shell-completions.sh with Shfmt * Don't expose the list_resolution_strategies option to the apps. * End all click option help strings with a dot for consistency
- Loading branch information
1 parent
b56718f
commit 0893f12
Showing
18 changed files
with
1,341 additions
and
1,446 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,206 +1,7 @@ | ||
"""__init__""" | ||
|
||
# global imports ------------------------------------------------------------------------------ | ||
from syncall.__version__ import __version__, __version_tuple__ | ||
from syncall.aggregator import Aggregator | ||
from syncall.app_utils import ( | ||
app_name, | ||
cache_or_reuse_cached_combination, | ||
fetch_app_configuration, | ||
fetch_from_pass_manager, | ||
get_config_name_for_args, | ||
get_resolution_strategy, | ||
inform_about_app_extras, | ||
inform_about_combination_name_usage, | ||
list_named_combinations, | ||
name_to_resolution_strategy_type, | ||
report_toplevel_exception, | ||
) | ||
from syncall.cli import ( | ||
opt_asana_task_gid, | ||
opt_asana_token_pass_path, | ||
opt_asana_workspace_gid, | ||
opt_asana_workspace_name, | ||
opt_combination, | ||
opt_custom_combination_savename, | ||
opt_filesystem_root, | ||
opt_gcal_calendar, | ||
opt_gkeep_labels, | ||
opt_gkeep_note, | ||
opt_gkeep_passwd_pass_path, | ||
opt_gkeep_user_pass_path, | ||
opt_google_oauth_port, | ||
opt_google_secret_override, | ||
opt_gtasks_list, | ||
opt_list_asana_workspaces, | ||
opt_list_combinations, | ||
opt_notion_page_id, | ||
opt_notion_token_pass_path, | ||
opt_resolution_strategy, | ||
opt_tw_project, | ||
opt_tw_tags, | ||
) | ||
from syncall.sync_side import ItemType, SyncSide | ||
from syncall.__version__ import __version__ as version | ||
from syncall.__version__ import __version_tuple__ as version_tuple | ||
|
||
__all__ = [ | ||
"__version__", | ||
"__version_tuple__", | ||
"Aggregator", | ||
"ItemType", | ||
"SyncSide", | ||
"app_name", | ||
"cache_or_reuse_cached_combination", | ||
"fetch_app_configuration", | ||
"fetch_from_pass_manager", | ||
"get_config_name_for_args", | ||
"inform_about_app_extras", | ||
"inform_about_combination_name_usage", | ||
"list_named_combinations", | ||
"get_resolution_strategy", | ||
"name_to_resolution_strategy_type", | ||
"opt_asana_task_gid", | ||
"opt_asana_token_pass_path", | ||
"opt_asana_workspace_gid", | ||
"opt_asana_workspace_name", | ||
"opt_combination", | ||
"opt_custom_combination_savename", | ||
"opt_gcal_calendar", | ||
"opt_gtasks_list", | ||
"opt_gkeep_note", | ||
"opt_gkeep_passwd_pass_path", | ||
"opt_gkeep_user_pass_path", | ||
"opt_google_oauth_port", | ||
"opt_google_secret_override", | ||
"opt_list_asana_workspaces", | ||
"opt_list_combinations", | ||
"opt_notion_page_id", | ||
"opt_notion_token_pass_path", | ||
"opt_resolution_strategy", | ||
"opt_tw_project", | ||
"opt_filesystem_root", | ||
"opt_tw_tags", | ||
"opt_gkeep_labels", | ||
"report_toplevel_exception", | ||
] | ||
|
||
# asana ---------------------------------------------------------------------------------------- | ||
try: | ||
from syncall.asana.asana_side import AsanaSide | ||
from syncall.asana.utils import list_asana_workspaces | ||
from syncall.tw_asana_utils import convert_asana_to_tw, convert_tw_to_asana | ||
|
||
__all__.extend( | ||
["AsanaSide", "convert_asana_to_tw", "convert_tw_to_asana", "list_asana_workspaces"] | ||
) | ||
except ImportError: | ||
pass | ||
|
||
# tw ------------------------------------------------------------------------------------------ | ||
try: | ||
from syncall.taskwarrior.taskwarrior_side import TaskWarriorSide | ||
|
||
__all__.extend( | ||
[ | ||
"TaskWarriorSide", | ||
] | ||
) | ||
except ImportError: | ||
pass | ||
|
||
# notion -------------------------------------------------------------------------------------- | ||
try: | ||
from syncall.notion.notion_side import NotionSide | ||
|
||
__all__.extend(["NotionSide"]) | ||
except ImportError: | ||
pass | ||
|
||
# notion <> tw -------------------------------------------------------------------------------- | ||
try: | ||
from syncall.tw_notion_utils import convert_notion_to_tw, convert_tw_to_notion | ||
|
||
__all__.extend(["convert_notion_to_tw", "convert_tw_to_notion"]) | ||
except ImportError: | ||
pass | ||
|
||
# gcal ---------------------------------------------------------------------------------------- | ||
try: | ||
from syncall.google.gcal_side import GCalSide | ||
from syncall.tw_gcal_utils import convert_gcal_to_tw, convert_tw_to_gcal | ||
except ImportError: | ||
__all__.extend( | ||
[ | ||
"GCalSide", | ||
"convert_gcal_to_tw", | ||
"convert_tw_to_gcal", | ||
] | ||
) | ||
|
||
# gtasks -------------------------------------------------------------------------------------- | ||
try: | ||
from syncall.google.gtasks_side import GTasksSide | ||
from syncall.tw_gtasks_utils import convert_gtask_to_tw, convert_tw_to_gtask | ||
except ImportError: | ||
__all__.extend( | ||
[ | ||
"GTasksSide", | ||
"convert_gtask_to_tw", | ||
"convert_tw_to_gtask", | ||
] | ||
) | ||
|
||
# gkeep --------------------------------------------------------------------------------------- | ||
try: | ||
from syncall.google.gkeep_note import GKeepNote | ||
from syncall.google.gkeep_note_side import GKeepNoteSide | ||
from syncall.google.gkeep_todo_item import GKeepTodoItem | ||
from syncall.google.gkeep_todo_side import GKeepTodoSide | ||
|
||
__all__.extend( | ||
[ | ||
"GKeepNote", | ||
"GKeepNoteSide", | ||
"GKeepTodoItem", | ||
"GKeepTodoSide", | ||
"convert_gkeep_todo_to_tw", | ||
"convert_tw_to_gkeep_todo", | ||
] | ||
) | ||
except ImportError: | ||
pass | ||
|
||
# gkeep <> tw | ||
try: | ||
from syncall.tw_gkeep_utils import convert_gkeep_todo_to_tw, convert_tw_to_gkeep_todo | ||
|
||
__all__.extend( | ||
[ | ||
"convert_gkeep_todo_to_tw", | ||
"convert_tw_to_gkeep_todo", | ||
] | ||
) | ||
except ImportError: | ||
pass | ||
|
||
# filesytem ----------------------------------------------------------------------------------- | ||
try: | ||
from syncall.filesystem.filesystem_file import FilesystemFile | ||
from syncall.filesystem.filesystem_side import FilesystemSide | ||
|
||
__all__.extend(["FilesystemFile", "FilesystemSide"]) | ||
except ImportError: | ||
pass | ||
|
||
|
||
# filesytem <> gkeep -------------------------------------------------------------------------- | ||
try: | ||
from syncall.filesystem_gkeep_utils import ( | ||
convert_filesystem_file_to_gkeep_note, | ||
convert_gkeep_note_to_filesystem_file, | ||
) | ||
|
||
__all__.extend( | ||
["convert_filesystem_file_to_gkeep_note", "convert_gkeep_note_to_filesystem_file"] | ||
) | ||
except ImportError: | ||
pass | ||
__all__ = ["version", "version_tuple"] |
Oops, something went wrong.