MoinMoin Wiki Calendar
A fixed version of EventCalendar is attached and corrects the bug report at the end of the page (along with some others) and is implemented as a parser (instead of a processor) and has been tested with MoinMoin 1.5.3. Fixed version is at http://moinmoin.wikiwikiweb.de/MoinMoinCalendarExample?action=AttachFile&do=view&target=FIXEDCalendar.py
Below is an example of a wiki calendar that the Calendar.py processor can display.
{ { {#!Calendar OPTION:bodyBGColor=#00D0D0 OPTION:captionBGColor=#D0D000 OPTION:firstWeekDay=6 20030328: Calendar 1.0 released 20030301: First of the month 20030331: End of the month 20030331: Last day... 20030401: First day of next month } } }
(for the above to render, you will need to copy the Calendar.py file to site-packages/MoinMoin/processor. You also need to be aware that the whole construct should be surrounded by {{{ ... }}} without the spaces used above - this is the case for all parsers/processors.)
Basically, each line describes one event. One can have multiple events for the same day. The calendar block will create as many month calendars as necessary. So as you probably noticed, the text describing the calendar rendered into two HTML calendars.
Currently, version 1.0 of the calendar (20030328) understands three options:
bodyBGColor: the HTML color of the cell bodies. Defaults to a light gray.
captionBGColor: the HTML color of the cell captions. Defaults to plain white.
firstWeekDay: 0 is Monday, 6 is Sunday. Defaults to Sunday (American style).
- for the default, should react to the user setting "date format", month first is american style, all else is european / international.
The color options belong to CSS, the last one to user prefs.
See also MoinMoinTodo/CalendarWidget.
This processor had a problem in that it wrote html to sys.stdout, which works fine under CGI but not so cool under the builtin webserver. I have a version in which this was changed by copying the output code from the CSV processor. Here CraigJohnson/Calendar.py
From comments in the header - work to do:-
- v1.1 handle date ranges for events
- v2.0 full wiki processing in each cell of calendar
I'm interested in getting both of these going. Date ranges is relatively simple once we have a decent spec for how they should be done without going so weird that only a real pro can use it.
Twiki does an extended calendar syntax, but their base syntax is bass ackwards to ours - see Twiki Calendar
An adaptation would have:-
20040701-20040731: Month of July (range) 20040701+20040731: 1st and 31st July (extra days)
I'm not sure how to do recurrances, and how to combine them... my gut feeling would be to use /<number> <period type> for a repeat every specified time period (e.g. 3 weeks, 2 days, 1 month, 30 days). Perhaps * could be used to specify the number of repeats, e.g.
20040701/1 week*28: Photograph the old oak tree.
Maybe we need extra options to force start and end date to prevent recurrances generating an infinite calendar - or just allow recurrances on ranges only, or both (could be useful to have one big calendar which then is included on several pages with different display ranges.
NigelMetheringham, 5 July 2004 Amended by MichaelFinnigan on the 7th of August, 2004
This is a great extension and we've been using it for small calendars, review schedules, etc. To avoid clutter, it would be nice to add a boolean parameter for whether to display months that have passed.
A range that allows both relative and absolute values would be even nicer, perhaps:
OPTION:startMonth=CURRENT OPTION:endMonth=200505
or maybe:
OPTION:startMonth=CURRENT OPTION:maxMonths=3
If omitted, the processor would default to showing everything like it does now.
I may try to add this functionality at some point and post the results back here, but I'd be happy if someone else felt inspired and wanted to beat me to it.
This crashes with MoinMoinDesktopEdition. If there is a seperate bugs page this goes on, I haven't seen it.
Below is a copy of the error report. I made one edit, spacing out the terminating brackets to prevent the code block from ending early.
TypeError__init__() keywords must be strings Please include this information in your bug reports!: Python Python 2.4: C:\Program Files\MoinMoin\MMDE\moin.exe Platform: win32 (nt) MoinMoin Release 1.3.3 [Revision patch-626; DesktopEdition Release 1.3.3-1] Tue Feb 22 02:18:47 2005 C:\Program Files\MoinMoin\MMDE\wiki\data\plugin\processor\Calendar.py in process(request=<MoinMoin.request.RequestStandAlone instance>, formatter=<MoinMoin.formatter.text_html.Formatter instance>, lines=[u'#!Calendar ', u'OPTION:bodyBGColor=#00D0D0', u'OPTION:captionBGColor=#D0D000', u'OPTION:firstWeekDay=6', u'20030328: Calendar 1.0 released', u'20030301: First of the month', u'20030331: End of the month', u'20030331: Last day...', u'20030401: First day of next month']) 185 for year in events.keys( ): 186 for month in events[year].keys( ): 187 cal = apply(EventCalendar, (year, month), kwargs) 188 for day in events[year][month].keys( ): 189 for event in events[year][month][day]: TypeError: __init__() keywords must be strings __doc__ = 'Inappropriate argument type.' __getitem__ = <bound method TypeError.__getitem__ of <exceptions.TypeError instance>> __init__ = <bound method TypeError.__init__ of <exceptions.TypeError instance>> __module__ = 'exceptions' __str__ = <bound method TypeError.__str__ of <exceptions.TypeError instance>> args = ('__init__() keywords must be strings',)
- Which file did you use? I cannot see any 1.3 compatible Calendar parser/processor.