def __init__(self, jd): self.eventsData = [] self.eventsDataIsSet = False self.pluginsText = '' ### self.jd = jd date = core.jd_to(jd, core.primaryMode) self.year, self.month, self.day = date self.weekDay = core.jwday(jd) self.weekNum = core.getWeekNumber(self.year, self.month, self.day) self.holiday = (self.weekDay in core.holidayWeekDays) ################### self.dates = [] for mode in range(len(calTypes)): if mode==core.primaryMode: self.dates.append((self.year, self.month, self.day)) else: self.dates.append(core.jd_to(jd, mode)) ################### for k in core.plugIndex: plug = core.allPlugList[k] if plug.enable: try: plug.update_cell(self) except: myRaiseTback() ################### self.eventsData = event_lib.getDayOccurrenceData(jd, eventGroups)
def __init__(self, jd): self.eventsData = [] #self.eventsDataIsSet = False ## not used self.pluginsText = '' ### self.jd = jd date = core.jd_to_primary(jd) self.year, self.month, self.day = date self.weekDay = core.jwday(jd) self.weekNum = core.getWeekNumber(self.year, self.month, self.day) #self.weekNumNeg = self.weekNum + 1 - core.getYearWeeksCount(self.year) self.weekNumNeg = self.weekNum - int(calTypes.primaryModule().avgYearLen / 7) self.holiday = (self.weekDay in core.holidayWeekDays) ################### self.dates = [ date if mode==calTypes.primary else jd_to(jd, mode) for mode in range(len(calTypes)) ] ''' self.dates = dict([ ( mode, date if mode==calTypes.primary else jd_to(jd, mode) ) for mode in calTypes.active ]) ''' ################### for k in core.plugIndex: plug = core.allPlugList[k] if plug.enable: try: plug.update_cell(self) except: myRaiseTback() ################### self.eventsData = event_lib.getDayOccurrenceData(jd, eventGroups)## here? FIXME
TagIconItem('education'), TagIconItem('holiday'), TagIconItem('travel'), ) getEventTagsDict = lambda: dict([(tagObj.name, tagObj) for tagObj in eventTags]) eventTagsDesc = dict([(t.name, t.desc) for t in eventTags]) ################### for fname in os.listdir(join(srcDir, 'accounts')): name, ext = splitext(fname) if ext == '.py' and name != '__init__': try: __import__('scal2.accounts.%s'%name) except: core.myRaiseTback() #print 'accounts', event_lib.classes.account.names ########### eventAccounts = event_lib.EventAccountsHolder() eventGroups = event_lib.EventGroupsHolder() eventTrash = event_lib.EventTrash() #try: # event_lib.checkAndStartDaemon()## FIXME here or in ui_*/event/main.py #except: # print 'Error while starting daemon' # myRaise()