Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize tags as list #78

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tasklib/serializing.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,14 @@ def deserialize_annotations(self, data):
return [TaskAnnotation(self, d) for d in data] if data else []

def serialize_tags(self, tags):
return ','.join(tags) if tags else ''
return list(tags)
Copy link
Member

Choose a reason for hiding this comment

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

The point of the serialization is to turn the object into a string representation, so this should be cast as a string.

That said, I am not yet entirely convinced this would work (i.e. with older versions of the TW). Maybe we can revive travis @robgolding ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have been using this branch for weeks with the latest taskwarrior version. The only issue that arose (#83) was due to me not knowing python well and is now fixed.
Why would we need to support old taskwarrior versions with new releases?

Reviving travis sounds good anyways though.


def deserialize_tags(self, tags):
if not tags:
set()
xeruf marked this conversation as resolved.
Show resolved Hide resolved
if isinstance(tags, str):
return set(tags.split(',')) if tags else set()
return set(tags or [])
return set(tags.split(','))
return set(tags)

def serialize_parent(self, parent):
return parent['uuid'] if parent else ''
Expand Down