A patch to render calendar from Sunday

Matsui Fe2+ Tetsushi <[email protected]> Sun, 04 Apr 2004 17:32:11 +0900
Newsgroups gmane.comp.pythin.pyds.devel
Message-ID <sa6y8pc3zzo.wl%[email protected]>
Hello,

I've been using PyDS 0.7.1 and feeling a liitle bit uncomfortable
with the calendar rendered Monday first. So I wrote a patch to enable
Sunday first rendering with configuration through PyDSConfig.py to set
firstweekday = 6.

Here is the patch.

--- CalendarTool.py.bak	2004-02-28 14:31:09.000000000 +0900
+++ CalendarTool.py	2004-04-04 17:01:06.000000000 +0900
@@ -38,8 +38,9 @@
 import PyDS.Tool
 
 import calendar
-calendar.setfirstweekday(calendar.MONDAY)
+calendar.setfirstweekday(_PyDS.firstweekday)
 wdnames = _('Mo Tu We Th Fr Sa Su').split()
+wdnames = wdnames[_PyDS.firstweekday:] + wdnames[:_PyDS.firstweekday]
 mlnames = _('January February March April May June July August September October November December').split()
 msnames = _('Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec').split()
 
--- DefaultConfig.py.bak	2004-04-04 16:55:05.000000000 +0900
+++ DefaultConfig.py	2004-04-04 17:03:08.000000000 +0900
@@ -149,6 +149,10 @@
 # end with / and is only used on access via the remoteip server!
 config.pathprefix = '/'
 
+# the first week day for calendar rendering.
+# Monday = 0, Tuesday = 1, ... and Sunday = 6.
+config.firstweekday = 0
+
 # these usually are't overwritten, they are used by Server.py and restore
 config.echoLog = 0
 config.proxy = ''


bye.
---
MATSUI Fe2+ Tetsushi
 http://homepage3.nifty.com/text/
 (http://lowlife.jp/mft/ for blog)