tasklib icon indicating copy to clipboard operation
tasklib copied to clipboard

Add coverage and support for user-defined attributes

Open tbabej opened this issue 10 years ago • 3 comments

Even though one can use user-defined attributes with tasklib, we:

  • Do not provide any official interface for them (one has to update the config dict). This maybe does not need to change.
  • Do not cover the use case in tests

tbabej avatar Jan 17 '15 11:01 tbabej

Some support will be needed though, since UDAs can have date values, and we need to serialize/deserialize that.

tbabej avatar Jan 17 '15 11:01 tbabej

Would love to see this implemented. As a workaround, I thought I'd post the hack I'm using to handle deserializing UDA dates:

import datetime
from tasklib.serializing import SerializingObject
serializer = SerializingObject({})
# dt is the UDA value I get from tasklib, I detect if it's already a datetime
# object for forwards-compatibility.
dt = dt if isinstance(dt, datetime.datetime) else serializer.timestamp_deserializer(dt)

thehunmonkgroup avatar May 13 '19 02:05 thehunmonkgroup

Do I correctly presume that there is no builtin way to parse the UDA of duration type? That'd be really nice to have as well ;) I'm hand coding a minimal enough parser, however a properly tested (and implemented) one would be fully in order. https://github.com/allgreed/tw-ical-feed/commit/1af68f76112600670e51dba431fa66009100f70d#diff-b10564ab7d2c520cdd0243874879fb0a782862c3c902ab535faabe57d5a505e1R63

allgreed avatar Mar 06 '24 20:03 allgreed