jspricke / python-remind

Python library to convert between Remind and iCalendar
GNU General Public License v3.0
13 stars 6 forks source link

Add hack to stop adding multiple repeat clauses #13

Closed samuelallan72 closed 3 years ago

samuelallan72 commented 3 years ago

This is a hacky fix for https://github.com/jspricke/python-remind/issues/12 - I don't know enough about ical or remind to know how bad this is.

It works well enough to fix the issues I was having (where I didn't care too much about the events that were causing the issues; I just wanted a valid remind file created).

jspricke commented 3 years ago

Thanks for your bug report and PR! I solved the problem in a non lossy way in master. Can you please test and report back? Closing this as fixed in master.

samuelallan72 commented 3 years ago

@jspricke thanks for your quick response! Unfortunately it's not quite working for me - for the example ical I shared in #12, it now produces:

REM SATISFY [trigdate()=='2018-04-30'||trigdate()=='2018-05-01'||trigdate()=='2018-05-02'||trigdate()=='2018-05-03'||trigdate()=='2018-05-04'||trigdate()=='2018-05-14'||trigdate()=='2018-05-15'||trigdate()=='2018-05-16'||trigdate()=='2018-05-17'||trigdate()=='2018-05-18'||trigdate()=='2018-05-28'||trigdate()=='2018-05-29'||trigdate()=='2018-05-30'||trigdate()=='2018-05-31'||trigdate()=='2018-06-01'||trigdate()=='2018-06-11'||trigdate()=='2018-06-12'||trigdate()=='2018-06-13'||trigdate()=='2018-06-14'||trigdate()=='2018-06-15'||trigdate()=='2018-06-25'||trigdate()=='2018-06-26'||trigdate()=='2018-06-27'||trigdate()=='2018-06-28'||trigdate()=='2018-06-29'||trigdate()=='2018-07-09'||trigdate()=='2018-07-10'||trigdate()=='2018-07-11'||trigdate()=='2018-07-12'||trigdate()=='2018-07-13'||trigdate()=='2018-07-23'||trigdate()=='2018-07-24'||trigdate()=='2018-07-25'||trigdate()=='2018-07-26'||trigdate()=='2018-07-27'||trigdate()=='2018-08-06'||trigdate()=='2018-08-07'||trigdate()=='2018-08-08'||trigdate()=='2018-08-09'||trigdate()=='2018-08-10'||trigdate()=='2018-08-20'||trigdate()=='2018-08-21'||trigdate()=='2018-08-22'||trigdate()=='2018-08-23'||trigdate()=='2018-08-24'] MSG example event

And remind complains with filename.rem(200): Can't compute trigger

jspricke commented 3 years ago

That's only a warning, starting with Remind 3.3.2 you can add the MAYBE-UNCOMPUTABLE keyword to suppress it. See the man page for more information. An other option would be to move old reminders to a different file and only load them if needed and with a close trigger date or rewrite the line in a more Remind friendly syntax (note that python-remind is limited to convert any reminder to one line to be able to track and modify them).

samuelallan72 commented 3 years ago

Ok, thanks. :)

An other option would be to move old reminders to a different file and only load them if needed and with a close trigger date or rewrite the line in a more Remind friendly syntax (note that python-remind is limited to convert any reminder to one line to be able to track and modify them).

I'm using this to sync http ics urls with remind locally, so that's not really an option.

jspricke commented 3 years ago

did you try the MAYBE-UNCOMPUTABLE? Would it help if we add it automatically?

samuelallan72 commented 3 years ago

@jspricke I did look for it, but looks like I'll need to wait for it to be updated in the Arch repositories (it's currently 3.3.1). Adding it automatically would be great! (although it may break things for users that can't update to 3.3.2 yet)

jspricke commented 3 years ago

OK, the new version is not yet in Debian either (due to the freeze), so I will wait a bit with adding the flag automatically.