Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
CMFPlone.CalendarTool.CalendarTool Class Reference
Inheritance diagram for CMFPlone.CalendarTool.CalendarTool:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.CalendarTool.CalendarTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getDayNumbers

Static Public Attributes

 meta_type = ToolNames.CalendarTool
tuple security = ClassSecurityInfo()
string toolicon = 'skins/plone_images/event_icon.gif'
int firstweekday = 0

Static Private Attributes

tuple __implements__ = (PloneBaseTool.__implements__, BaseTool.__implements__, )

Detailed Description

Definition at line 7 of file CalendarTool.py.


Member Function Documentation

Returns a list of daynumbers with the correct start day first.

>>> import calendar

CMFCalendar / Python's calendar module and the translation service tool
use different values for the first day of week. To get the right
localized day names with the translation service tool we need a method
to return the days in the order used by CMFCalendar.

>>> fwday = (calendar.firstweekday()+1) % 7

>>> ctool = CalendarTool()

>>> ctool.getDayNumbers()[0] == fwday
True

Definition at line 18 of file CalendarTool.py.

00018 
00019     def getDayNumbers(self):
00020         """ Returns a list of daynumbers with the correct start day first.
00021 
00022         >>> import calendar
00023 
00024         CMFCalendar / Python's calendar module and the translation service tool
00025         use different values for the first day of week. To get the right
00026         localized day names with the translation service tool we need a method
00027         to return the days in the order used by CMFCalendar.
00028 
00029         >>> fwday = (calendar.firstweekday()+1) % 7
00030 
00031         >>> ctool = CalendarTool()
00032 
00033         >>> ctool.getDayNumbers()[0] == fwday
00034         True
00035         """
00036         firstweekday = self._getCalendar().firstweekday()+1
00037         return [i%7 for i in range(firstweekday, firstweekday + 7)]
00038 
00039 CalendarTool.__doc__ = BaseTool.__doc__
00040 
00041 InitializeClass(CalendarTool)

Here is the call graph for this function:


Member Data Documentation

tuple CMFPlone.CalendarTool.CalendarTool.__implements__ = (PloneBaseTool.__implements__, BaseTool.__implements__, ) [static, private]

Definition at line 13 of file CalendarTool.py.

Definition at line 15 of file CalendarTool.py.

Definition at line 9 of file CalendarTool.py.

tuple CMFPlone.CalendarTool.CalendarTool.security = ClassSecurityInfo() [static]

Definition at line 10 of file CalendarTool.py.

string CMFPlone.CalendarTool.CalendarTool.toolicon = 'skins/plone_images/event_icon.gif' [static]

Definition at line 11 of file CalendarTool.py.


The documentation for this class was generated from the following file: