[icalendar-dev] how to verify if a date is into the ical file ?
Matt Chisholm
matt-icalendar at mosuki.com
Fri Mar 30 17:36:49 CEST 2007
You don't need iCalendar to do this. Just do:
found = open('/path/to/france.ics','r').read().find('20070521') != -1
Of course, that will fail if somebody puts '20070521' in an event
summary or description.
-m
On Mar 30 2007, 17:24, Michael REMY Askus wrote:
>hi,
>
>this is my first question after subscribed to the mailing list.
>This module is very useful for my application (TinyERP) to determinate
>easter days (stored in a iCal file)
>
>But, i don't find in the doc how to verifiy is a date is present or not
>into a iCal file.
>What is the method ?
>
>In waiting your answer, i justed do a string presence of the date, like
>a novice !
>for exampl :
>
>from icalendar import Calendar, Event
> cal =
>Calendar.from_string(open('/home/remy/local/dev/cvs_cpn/SV3.4.0.1/bin/icalendar/france.ics','rb').read())
>
> txt=str(cal)
> found=False
>
> thedate="20070521"
> if (found==False and txt.find(thedate)!=-1):
> found=True
>
>So, is there any method to test a date instead this string search one ??
>
>Thank for help
>
>Mike (from France)
>
>_______________________________________________
>icalendar-dev mailing list
>icalendar-dev at codespeak.net
>http://codespeak.net/mailman/listinfo/icalendar-dev
More information about the icalendar-dev
mailing list