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

[WIP] Add preliminary support for VTODOs #1118

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

evilham
Copy link

@evilham evilham commented Mar 17, 2022

Hey, I'm evaluating khal and as others have mentioned, VTODOs should really be listed.

Since this is a must for me, I created a
quick PoC that converts VTODOs to VEVENTs before adding them to the
backend, this enables us to not treat tasks as something very special.

If this approach is interesting enough, it should be forbidden that
khal edits tasks as it is out of its scope.

This would fix #448

I noticed that the sqlite3 database should be deleted in order to force khal to process any pre-existing VTODOs (probably just a matter of the vdir being 'up-to-date'). Don't think that's an issue.

This is the output with a recurrent meeting and a task:

> rm khal.db; khal list
warning: Event start time and end time are the same. Assuming the event's duration is one hour.
Today, 2022-03-17
16:00-17:00 Meeting ⟳
19:00-20:00 [ ] test task222 ✏

And when the task has been marked as done:

> todo done 1
[X] 1  32 minutes ago test task222 @CALENDAR (100%)
> khal list
Today, 2022-03-17
16:00-17:00 Meeting ⟳
19:00-20:00 [X] test task222 ✏

evilham and others added 2 commits March 17, 2022 20:26
Quick PoC that converts VTODOs to VEVENTs before adding them to the
backend, this enables us to not treat tasks as something very special.

If this approach is interesting enough, it should be forbidden that
khal edits tasks as it is out of its scope.

This would fix pimutils#448
@evilham
Copy link
Author

evilham commented Mar 17, 2022

Forgot to make it explicit that: "convert VTODOs into VEVENTs" only applies to the in-memory representation while importing the data, since what is saved into sqlite3 is the raw text and what is used for representation comes from there as well, this is fully compatible with the represented object being a VTODO in the underlying vdir.

Since we would forbid khal from editing VTODOs, this should be a safe way to import and list the data.

@evilham evilham mentioned this pull request Mar 17, 2022
@hsanson
Copy link

hsanson commented Mar 19, 2022

@evilham sounds interesting. Not sure why but I am unable to get this working.

I created a test task using todoman:

> todo
33  [ ]  !!  in 23 hours   Test Task @Personal

But Khal does not show it:

> khal list
Today, 2022-03-19
10:00-11:00 〇〇終業式
Tomorrow, 2022-03-20
09:30-10:30 オレンジクラッカー
月曜日, 2022-03-21
 〇〇ちゃん誕生日 ⟳
火曜日, 2022-03-22

This is the VTODO entry in my calendars folder:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:io.barrera.todoman
BEGIN:VTODO
CREATED;VALUE=DATE-TIME:20220319T051007Z
DESCRIPTION:Test Task
DTSTAMP;VALUE=DATE-TIME:20220319T051007Z
DUE;VALUE=DATE-TIME:20220320T051007Z
LAST-MODIFIED;VALUE=DATE-TIME:20220319T051030Z
LOCATION:Home
PRIORITY:5
SEQUENCE:1
STATUS:NEEDS-ACTION
SUMMARY:Test Task
UID:bb0c846851274cd7a96f83c99b063aeb@mini
END:VTODO
END:VCALENDAR

Potential points of problem:

  • My computer is set in Japanese. Low chance this can be causing some issues as Python is not really good at handling non English text.
  • I have many calendars. This task was created in my Personal one.

Also I verified I am using the correct branch:

commit 0bcff973fe4461b676f5078881fb5425bfadc381 (HEAD -> 448-evilham-vtodos)
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Thu Mar 17 19:35:22 2022 +0000

    [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci

commit 631c4f68f1346f56688fa20c36fc351c256c0b28
Author: Evilham <contact@evilham.com>
Date:   Thu Mar 17 20:26:31 2022 +0100

    [WIP] Add preliminary support for VTODOs

    Quick PoC that converts VTODOs to VEVENTs before adding them to the
    backend, this enables us to not treat tasks as something very special.

    If this approach is interesting enough, it should be forbidden that
    khal edits tasks as it is out of its scope.

    This would fix #448

@evilham
Copy link
Author

evilham commented Mar 19, 2022

Thanks for the testing! I don't think Japanese has anything to do with it :-D most likely I missed a code path that was breaking; could you try again?

If that doesn't work, could you check if there is a higher verbosity setting for khal that might give us more info?

@hsanson
Copy link

hsanson commented Mar 20, 2022

@evilham working nice:

Tomorrow, 2022-03-21
 〇〇ちゃん誕生日 ⟳
14:10-15:10 [X] Test Task ✏ :: Test Task
18:57-19:57 [ ] Test 3 ✏ :: Test 3

Also in interactive view:

┃      2  3  4  5  6  7  8   ┃│                                           │
┃      9 10 11 12 13 14 15   ┃│Tomorrow (月曜日, 2022-03-21)             │
┃     16 17 18 19 20 21 22   ┃│  〇〇ちゃん誕生日 ⟳                        │
┃     23 24 25 26 27 28 29   ┃│ 14:10-15:10 [X] Test Task ✏ :: Test Task │
┃ 6月 30 31  1  2  3  4  5   ┃│ 18:57-19:57 [ ] Test 3 ✏ :: Test 3       │
┃                            ┃│                                          

@evilham
Copy link
Author

evilham commented Mar 21, 2022

That's great! please report any oddities and do not try to edit tasks with khal :-D.

@slotThe
Copy link

slotThe commented Apr 19, 2022

@evilham I can't speak for the code (I know neither the code base, nor python :) but I've been using this for a bit on my universities internal nextcloud server (with khalel, even) and it already works great—so thanks!

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.

Add support for VTODO
4 participants