Edgewall Software

Opened 12 years ago

Last modified 9 years ago

#10541 closed defect

ListOption seems to ignore/suppress 0 — at Initial Version

Reported by: Chris Nelson <Chris.Nelson@…> Owned by:
Priority: normal Milestone: 1.0.1
Component: general Version: 0.11.6
Severity: major Keywords: config
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm trying to add a list of work days (days of the week) to TeamCalendar plugin. Near the top I do:

class TeamCalendar(Component):
    implements(INavigationContributor, IRequestHandler, IPermissionRequestor, 
               ITemplateProvider)

...
    # Default work week.
    work_days = ListOption('team-calendar',
                            'work_days',
                            [0, 1, 2, 3, 4],
                            doc="Lists days of week that are worked. " + \
                                "Defaults to none.  0 is Monday.")

and later

        self.env.log.debug('work_days: %s ' % self.work_days)

        timetable = {}
        current_date = from_date
        while current_date <= to_date:
            if current_date.weekday() in self.work_days:

The log does not show the 0, only 1..4. If I set the default to [99, 0, 1, 2, 3, 4], the log shows 99 but not 0 so it isn't the first element that's getting dropped.

Change History (0)

Note: See TracTickets for help on using tickets.