Skip to content

Conversation

@hardaker
Copy link
Contributor

@hardaker hardaker commented Feb 18, 2025

Note, this add support for adding tags to tasks when creating them:

habitipy todos add -t myshineytag my new todo entry

And for limiting lists as well:

habitipy todos -t myshineytag

Note to consider: There are three instances where the API returns a dict, by mypy expects a list so I'm using cast() to properly cast them to dicts (which they already are). The right thing to do would be fix the post API return specification, but I wasn't sure how to do that. What I did works, but if someone wants to tackle fixing the API itself that would be better.

@hardaker
Copy link
Contributor Author

This also solves issue #15

Copy link
Owner

@asmfreak asmfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! Please, fix my comments

class Habits(TasksPrint): # pylint: disable=missing-docstring
DESCRIPTION = _("List, up and down habit tasks") # noqa: Q000
domain = 'habits'
tag = cli.SwitchAttr(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please try to move this to its base class (TagsHelper)?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please use a repeatable switch. See plumbum docs on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants