jspricke / python-icstask

Python library to convert between Taskwarrior and vObject
GNU General Public License v3.0
14 stars 5 forks source link

vobject has no attribute vtodo_list #2

Closed ix- closed 6 years ago

ix- commented 6 years ago
 ics2task ~/dl/ww.ics ww.task
   Traceback (most recent call last):
  File "/tmp/spam/lib/python3.6/site-packages/vobject/base.py", line 527, in __getattr__
     return self.contents[toVName(name, 5)]
 KeyError: 'vtodo'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/tmp/spam/bin/ics2task", line 11, in <module>
    sys.exit(ics2task())
   File "/tmp/spam/lib/python3.6/site-packages/icstask.py", line 301, in ics2task
    for todo in vobject.vtodo_list:
   File "/tmp/spam/lib/python3.6/site-packages/vobject/base.py", line 531, in __getattr__
     raise AttributeError(name)
  AttributeError: vtodo_list

https://github.com/jspricke/python-icstask/blob/93d2686daee24730b7659b841289acb904bb936a/icstask.py#L302

Best regards, ix

jspricke commented 6 years ago

Hey, can you append the content of ~/dl/ww.ics so I can try it over here? (Make sure not to include private information).

ix- commented 6 years ago

had to rename it, as gh does not support ics (as extention...) ww.txt

jspricke commented 6 years ago

Well, it contains no vtodo entries (as the error message says). What would you expect ics2task to do with it?

ix- commented 6 years ago

I'd like it to record the dates as scheduled. Ok, maybe I did not really understand what the ics2task does. Than I'm sorry.

jspricke commented 6 years ago

We could write a simple script to convert vevents to vtodos, but I don't see it as part of this project.

ix- commented 6 years ago

Ok, what I expected:

If you do not see this as part of the project, mark the issue as closed. Thanks

jspricke commented 6 years ago

ics files can contain VEVENT, VTODO and VJOURNAL entries. ics2task only handles the VTODO part. You can try this as a start: sed -s 's/VEVENT/VTODO/g' ww.ics | ics2task

ix- commented 6 years ago

Thx! Maybe include this in the readme, this was not clear to me. Best regards.

jspricke commented 6 years ago

Done, thanks for coming up with this :). Is the sed call enough for you, already?

jspricke commented 6 years ago

maybe you rather want something like this? sed -e 's/VEVENT/VTODO/' -e 's/DTSTART/DUE/' ww.ics | ics2task