示例#1
0
 def _checkParams(self, params):
     categIdList = self._normaliseListParam(params.get("selCateg", []))
     self._categList = []
     cm = conference.CategoryManager()
     for id in categIdList:
         try:
             self._categList.append(cm.getById(id))
         except KeyError:
             continue
     self._target = self._categList
     if not self._categList:
         cm = conference.CategoryManager()
         self._categList.append(cm.getRoot())
     tz = DisplayTZ(self._aw).getDisplayTZ()
     months = params.get("months", 3)
     columns = params.get("columns", 3)
     month = int(
         params.get("month",
                    (nowutc() - relativedelta(months=1)).astimezone(
                        timezone(tz)).month))
     year = int(params.get("year", nowutc().astimezone(timezone(tz)).year))
     sdate = timezone(tz).localize(datetime(year, month, 1))
     self._cal = wcalendar.MonthCalendar( self._aw, \
                                             sdate, \
                                             months, \
                                             columns, \
                                             self._categList )
     self._categ = self._categList[0]
示例#2
0
 def _checkParams(self, params):
     categIdList = self._normaliseListParam(params.get("selCateg", []))
     self._categList = []
     cm = conference.CategoryManager()
     for id in categIdList:
         self._categList.append(cm.getById(id))
     tz = DisplayTZ(self._aw).getDisplayTZ()
     sdate = timezone(tz).localize(datetime(int(params.get("sDate", "")[0:4]),\
                                 int(params.get("sDate", "")[5:7]),\
                                 int(params.get("sDate", "")[8:])))
     months = params.get("months", 6)
     self._cal = wcalendar.MonthCalendar( self._aw, \
                                             sdate, \
                                             months, \
                                             3, \
                                             self._categList )
     xs = self._normaliseListParam(params.get("xs", []))
     self._expanded = []
     for id in xs:
         self._expanded.append(cm.getById(id))