* Dianne Skoll <[email protected]> [2020-01-13 18:35]:
- Add an element with the complete body, i.e. %\"bar%\" Foo today,
or maybe two elements one with the calendar mode entry (bar) and one
with the rest (Foo today)

Hmm, that's tricky.  I have to think about that.

Which part would be tricky? The complete body or splitting it into two elements?

- Why is there date, time, d, m, y and eventstart? Shoudn't one
format be enough?

No, they all mean different things:

date is the trigger date
d, m and y are present ONLY if the corresponding part is present in the
REM command.  Have a look:

$ echo "REM 13 AT 20:00 MSG test" | ./src/remind -pp -b2 -
{"date":"2020-01-13", "time":1200, "d":13, "eventstart":"2020-01-13T20:00",
"priority":5000, "body":"test"}

There are no "y" and "m" elements because those were missing.  So the back-end
can know that this reminder will trigger on the 13th of every month.

I'm not sure if this is really useful, at least not for python-remind. As far as I understand we can always have a context that limits the repetition (like have a global OMIT and add a SKIP). So I can't deduce the repetition from the absence alone but would have to evaluate the complete input file at which point it defeats the purpose of reading the Remind output. So for python-remind I let Remind evaluate the input file and try to generate repetition rules based on the evaluated output. Or am I missing something?

time and eventstart can differ for multi-day events, as in:

$ echo "REM 12 AT 20:00 DURATION 24:00 MSG test" | ./src/remind -pp -b2 -
{"date":"2020-01-12", "duration":1440, "time":1200, "eventduration":1440,
"d":12, "eventstart":"2020-01-12T20:00", "priority":5000, "body":"test"}
{"date":"2020-01-13", "duration":1200, "time":0, "eventduration":1440, "d":12,
"eventstart":"2020-01-12T20:00", "priority":5000, "body":"test"}

Good point, so for python-remind I would condense this again to one icalendar entry using the eventstart as the key (is the assumption that I can merge it always true)?
Would it be possible to have a mode to only output this event once?

- Have a pure json output without the rem2ps2 lines wrapped in a
json array [].

I was thinking of doing that, but didn't because it reduces the amount of
memory you need for parsing JSON, especially in C code like rem2ps.  It
is a little bit ugly, I admit, and I might be persuaded to change that. :)

I see where you are coming from, but up to now I didn't hit any memory barrier with my reminders. Also, as detailed above, I would probably read in all elements anyhow to do repetition calculation and so on (python-remind currently has a logic to cache all reminders and to rerun Remind only on file or day change). So for me the question is more if I can dump the Remind output directly into a json parser or have to filter it first.

Cheers Jochen

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Remind-fans mailing list
[email protected]
https://dianne.skoll.ca/mailman/listinfo/remind-fans
Remind is at https://dianne.skoll.ca/projects/remind/

Reply via email to