rrule.__str__() method

Bug #943512 reported by James Emerton on 2012-02-29
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

I would like to see a __str__() method on the RRULE object that recreates the RRULE string.

I will be implementing this via monkey-patch for the time being, and I will provide the code here one the work is complete.

See also #943509

Tomi Hukkalainen (tpievila) wrote :

This would be a nice feature indeed. If you can supply a patch to dateutils I'll incorporate it to trunk right away. There's also a new release coming soonish, as soon as we can get the cheeseshop to play nice with permissions. If the patch is ready before that, I'll get that into the release as well.

James Emerton (james-2qie2h1nj) wrote :

Attached patch which adds rrule.__str__() method.

Requires patch in bug #943509

Tomi Hukkalainen (tpievila) wrote :

I haven't had time to review this properly, but as a reminder to myself I need to do some real checking that the resulting iCalendar is correct. The obvious gotcha here is at least the BYWEEKDAY, which is just a dateutil convention :

"Notice that in the RFC documentation, this is specified as BYDAY, but was renamed to avoid the ambiguity of that keyword. "

There might be more, but likely the more tricky parts are in the public interface patch.

iamrohitbanga (iamrohitbanga) wrote :

I too need this feature.

As a workaround is it ok to store the output of myrrule.__dict__ in a database as a string and then recover the rrule object when required using the dictionary string.

nu everest (nu-everest) wrote :

How do I apply this patch? I've never applied a patch before, and it makes me a little wary given that I don't want to break my code and I want to be able to "undo" the patch if necessary.

Tal Gariby (garibyta) wrote :

Will there be a version with this feature someday?
(iCalendar representation of rrule and rruleset)

Artem (giliardi-arts) wrote :

Hey, guys,

Is there any news about this and when it will be added to python-dateutil module?
I can help writing tests to it

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers