def __init__(self, path, enable=None, show_date=None): default_enable = True default_show_date = False exec(open(path).read()) #execfile(path) if enable==None: enable = default_enable if show_date==None: show_date = default_show_date BasePlugin.__init__(self, path, None, desc, enable, show_date, about, authors, has_config, False) self.holidays = {} for modeName in holidays.keys():## .keys() in not neccesery try: mode = moduleNames.index(modeName) except ValueError: continue self.holidays[mode] = holidays[modeName]
def __init__(self, path, mode=0, desc='', enable=True, show_date=False, about=None, authors=[], has_config=False, has_image=False, last_day_merge=True): self.external = False self.path = path if mode==None or isinstance(mode, int): self.mode = mode else: try: self.mode = moduleNames.index(mode) except ValueError: log.error('Plugin "%s" needs calendar module "%s" that is not loaded!\n'%(path, mode)) self.mode = None self.desc = desc self.enable = enable self.show_date = show_date self.about = about self.authors = authors self.has_config = has_config self.has_image = has_image self.last_day_merge = last_day_merge ######### self.text = '' self.holiday = False self.load()
from scal2.cal_modules import moduleNames, moduleDescNames from scal2 import core from scal2.core import jd_to, to_jd from scal2.locale_man import rtl, dateLocale from scal2.locale_man import tr as _ from scal2 import ui import gtk from gtk import gdk from scal2.ui_gtk.mywidgets.multi_spin_button import DateButton from scal2.ui_gtk.utils import dialog_add_button hijriMode = moduleNames.index('hijri') def getCurrentYm(): (y, m, d) = ui.todayCell.dates[hijriMode] return y*12 + m-1 class EditDbDialog(gtk.Dialog): def __init__(self):## parent FIXME gtk.Dialog.__init__(self) self.set_title(_('Tune Hijri Monthes')) self.connect('delete-event', self.onDeleteEvent) ############ self.altMode = 0 self.altModeDesc = 'Gregorian' ############ hbox = gtk.HBox()