MonthCalendar
This macro is for those who want to use MoinMoin as a Personal Information Manager and need a calendar wiki integration.
Example
Usage: [[MonthCalendar(BasePage,year,month,monthoffset,monthoffset2,height6)]] each parameter can be empty and then defaults to currentpage or currentdate or monthoffset=0 Samples: Calendar of Page SampleUser, this year's december: [[MonthCalendar(SampleUser,,12)]] Calendar of current Page, this year's december: [[MonthCalendar(,,12)]] Calendar of December, 2001: [[MonthCalendar(,2001,12)]] Calendar of the month two months after December, 2001 (maybe doesn't make much sense, but is possible) [[MonthCalendar(,2001,12,+2)]] Calendar of year 2002 (every month padded to height of 6): ||||||Year 2002|| ||[[MonthCalendar(,2002,1,,,1)]]||[[MonthCalendar(,2002,2,,,1)]]||[[MonthCalendar(,2002,3,,,1)]]|| ||[[MonthCalendar(,2002,4,,,1)]]||[[MonthCalendar(,2002,5,,,1)]]||[[MonthCalendar(,2002,6,,,1)]]|| ||[[MonthCalendar(,2002,7,,,1)]]||[[MonthCalendar(,2002,8,,,1)]]||[[MonthCalendar(,2002,9,,,1)]]|| ||[[MonthCalendar(,2002,10,,,1)]]||[[MonthCalendar(,2002,11,,,1)]]||[[MonthCalendar(,2002,12,,,1)]]|| Current calendar of me, also showing entries of A and B: [[MonthCalendar(MyPage*TestUserA*TestUserB)]] SubPage calendars: [[MonthCalendar(MyName/CalPrivate)]] [[MonthCalendar(MyName/CalBusiness)]] [[MonthCalendar(MyName/CalBusiness*MyName/CalPrivate)]] Anniversary Calendars: (no year data) [[MonthCalendar(Yearly,,,+1,,6,1)]] This creates calendars of the format Yearly/MM-DD By leaving out the year, you can set birthdays, and anniversaries in this calendar and not have to re-enter each year.
Display
The simplest version looks like this:
--> -->ValueError
year is out of range
If you want to report a bug, please save this page and attach it to your bug report.
Traceback
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/request.py in run (self=<MoinMoin.request.RequestCGI object at 0x402e644c>)
- 1170 self.page.send_page(self, msg=msg)
- 1171 else:
- 1172 handler(self.page.page_name, self)
- 1173
- 1174 # generate page footer (actions that do not want this footer use
- handler = <function do_show at 0x4058295c>
- self = <MoinMoin.request.RequestCGI object at 0x402e644c>
- self.page = <MoinMoin.Page.Page instance at 0x4057476c>
- self.page.page_name = u'HelpOnMacros/MonthCalendar'
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/wikiaction.py in do_show (pagename=u'HelpOnMacros/MonthCalendar', request=<MoinMoin.request.RequestCGI object at 0x402e644c>)
- 466 else:
- 467 request.cacheable = 1
- 468 Page(request, pagename).send_page(request, count_hit=1)
- 469
- 470
- global Page = <class MoinMoin.Page.Page at 0x405686bc>
- request = <MoinMoin.request.RequestCGI object at 0x402e644c>
- pagename = u'HelpOnMacros/MonthCalendar'
- ).send_page undefined
- count_hit undefined
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/Page.py in send_page (self=<MoinMoin.Page.Page instance at 0x4066c16c>, request=<MoinMoin.request.RequestCGI object at 0x402e644c>, msg='', **keywords={'count_hit': 1})
- 1254 format_args=pi_formatargs,
- 1255 do_cache=do_cache,
- 1256 start_line=pi_lines)
- 1257
- 1258 # check for pending footnotes
- start_line undefined
- pi_lines = 4
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/Page.py in send_page_content (self=<MoinMoin.Page.Page instance at 0x4066c16c>, request=<MoinMoin.request.RequestCGI object at 0x402e644c>, Parser=<class MoinMoin.parser.wiki.Parser at 0x40699d4c>, body=u'== MonthCalendar ==\n\nThis macro is for those who...lendar(OtherUser,,,-1)]]\n\nsee also: HelpOnMacros\n', format_args=u'', do_cache=1, **kw={'start_line': 4})
- 1345 try:
- 1346 code = self.loadCache(request)
- 1347 self.execute(request, parser, code)
- 1348 except Exception, e:
- 1349 if not is_cache_exception(e):
- self = <MoinMoin.Page.Page instance at 0x4066c16c>
- self.execute = <bound method Page.execute of <MoinMoin.Page.Page instance at 0x4066c16c>>
- request = <MoinMoin.request.RequestCGI object at 0x402e644c>
- parser = <MoinMoin.parser.wiki.Parser instance at 0x4066c7ec>
- code = <code object <module> at 0x404ee0b0, file "HelpOnMacros/MonthCalendar", line 2>
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/Page.py in execute (self=<MoinMoin.Page.Page instance at 0x4066c16c>, request=<MoinMoin.request.RequestCGI object at 0x402e644c>, parser=<MoinMoin.parser.wiki.Parser instance at 0x4066c7ec>, code=<code object <module> at 0x404ee0b0, file "HelpOnMacros/MonthCalendar", line 2>)
- 1374 __file__ = os.path.join(MoinMoin.__loader__.archive, 'dummy')
- 1375 try:
- 1376 exec code
- 1377 except 'CacheNeedsUpdate':
- 1378 raise Exception('CacheNeedsUpdate')
- code = <code object <module> at 0x404ee0b0, file "HelpOnMacros/MonthCalendar", line 2>
/home/pangloss/public_html/Tabula/HelpOnMacros/MonthCalendar in
() /home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/formatter/base.py in macro (self=<MoinMoin.formatter.text_html.Formatter instance at 0x4068710c>, macro_obj=<MoinMoin.wikimacro.Macro instance at 0x4066c84c>, name=u'MonthCalendar', args=None)
- 288 def macro(self, macro_obj, name, args):
- 289 # call the macro
- 290 return macro_obj.execute(name, args)
- 291
- 292 def _get_bang_args(self, line):
- macro_obj = <MoinMoin.wikimacro.Macro instance at 0x4066c84c>
- macro_obj.execute = <bound method Macro.execute of <MoinMoin.wikimacro.Macro instance at 0x4066c84c>>
- name = u'MonthCalendar'
- args = None
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/wikimacro.py in execute (self=<MoinMoin.wikimacro.Macro instance at 0x4066c84c>, macro_name=u'MonthCalendar', args=None)
- 118 else:
- 119 raise ImportError("Cannot load macro %s" % macro_name)
- 120 return execute(self, args)
- 121
- 122 def _m_lang(self, text):
- execute = <function execute at 0x406f195c>
- self = <MoinMoin.wikimacro.Macro instance at 0x4066c84c>
- args = None
/home/pangloss/lib/python/lib/python2.5/site-packages/MoinMoin/macro/MonthCalendar.py in execute (macro=<MoinMoin.wikimacro.Macro instance at 0x4066c84c>, text=None)
- 296
- 297 # get the calendar
- 298 monthcal = calendar.monthcalendar(year, month)
- 299
- 300 # european / US differences
- monthcal undefined
- global calendar = <module 'calendar' from '/home/pangloss/lib/python/lib/python2.5/calendar.pyc'>
- calendar.monthcalendar = <bound method TextCalendar.monthdayscalendar of <calendar.TextCalendar object at 0x40716c8c>>
- year = 0
- month = 2
/home/pangloss/lib/python/lib/python2.5/calendar.py in monthdayscalendar (self=<calendar.TextCalendar object at 0x40716c8c>, year=0, month=2)
- 210 Each row represents a week; days outside this month are zero.
- 211 """
- 212 days = list(self.itermonthdays(year, month))
- 213 return [ days[i:i+7] for i in xrange(0, len(days), 7) ]
- 214
- days undefined
- builtin list = <type 'list'>
- self = <calendar.TextCalendar object at 0x40716c8c>
- self.itermonthdays = <bound method TextCalendar.itermonthdays of <calendar.TextCalendar object at 0x40716c8c>>
- year = 0
- month = 2
/home/pangloss/lib/python/lib/python2.5/calendar.py in itermonthdays (self=<calendar.TextCalendar object at 0x40716c8c>, year=0, month=2)
- 181 outside the specified month the day number is 0.
- 182 """
- 183 for date in self.itermonthdates(year, month):
- 184 if date.month != month:
- 185 yield 0
- date undefined
- self = <calendar.TextCalendar object at 0x40716c8c>
- self.itermonthdates = <bound method TextCalendar.itermonthdates of <calendar.TextCalendar object at 0x40716c8c>>
- year = 0
- month = 2
/home/pangloss/lib/python/lib/python2.5/calendar.py in itermonthdates (self=<calendar.TextCalendar object at 0x40716c8c>, year=0, month=2)
- 154 dates outside the specified month.
- 155 """
- 156 date = datetime.date(year, month, 1)
- 157 # Go back to the beginning of the week
- 158 days = (date.weekday() - self.firstweekday) % 7
- date undefined
- global datetime = <module 'datetime' from '/home/pangloss/lib/python/lib/python2.5/lib-dynload/datetime.so'>
- datetime.date = <type 'datetime.date'>
- year = 0
- month = 2
ValueError
year is out of range
- args = ('year is out of range',)
- message = 'year is out of range'
System Details
- Date: Wed, 15 Jul 2026 23:03:31 +0000
- Platform: Linux owl.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686
- Python: Python 2.5 (/home/pangloss/lib/python/bin/python)
- MoinMoin: Release 1.5.7 (release)
