def __init__(self, event): gtk.Expander.__init__(self) self.set_label(_('Notification')) self.event = event self.hboxDict = {} totalVbox = gtk.VBox() ### hbox = gtk.HBox() pack(hbox, gtk.Label(_('Notify')+' ')) self.notifyBeforeInput = DurationInputBox() pack(hbox, self.notifyBeforeInput, 0, 0) pack(hbox, gtk.Label(' '+_('before event'))) pack(hbox, gtk.Label(), 1, 1) pack(totalVbox, hbox) ### for cls in event_lib.classes.notifier: notifier = cls(self.event) inputWidget = makeWidget(notifier) if not inputWidget: printError('notifier %s, inputWidget = %r'%(cls.name, inputWidget)) continue hbox = gtk.HBox() cb = gtk.CheckButton(notifier.desc) cb.inputWidget = inputWidget cb.connect('clicked', lambda check: check.inputWidget.set_sensitive(check.get_active())) cb.set_active(False) pack(hbox, cb) hbox.cb = cb #pack(hbox, gtk.Label(''), 1, 1) pack(hbox, inputWidget, 1, 1) hbox.inputWidget = inputWidget self.hboxDict[notifier.name] = hbox pack(totalVbox, hbox) self.add(totalVbox)
'name', 'desc', 'origLang', 'getMonthName', 'getMonthNameAb', 'minMonthLen', 'maxMonthLen', 'getMonthLen', 'to_jd', 'jd_to', 'options', 'save', ): if not hasattr(mod, attr): printError( 'Invalid calendar module: module "%s" has no attribute "%s"\n'\ %(name, attr) ) modules.append(mod) class CalTypesHolder: byName = dict([(mod.name, mod) for mod in modules]) names = [mod.name for mod in modules] ## calOrigLang = [m.origLang for m in modules] __len__ = lambda self: len(self.names) def __init__(self): self.activeNames = ['gregorian'] self.inactiveNames = [] self.update() ##attributemethod ## FIXME
"name", "desc", "origLang", "getMonthName", "getMonthNameAb", "minMonthLen", "maxMonthLen", "getMonthLen", "to_jd", "jd_to", "options", "save", ): if not hasattr(mod, attr): printError("Invalid calendar module: " + "module \"%s\" has no attribute \"%s\"\n" % (name, attr)) modules.append(mod) class CalTypesHolder: byName = {mod.name: mod for mod in modules} names = [mod.name for mod in modules] # calOrigLang = [m.origLang for m in modules] def __len__(self): return len(self.names) def __init__(self): self.activeNames = ["gregorian"]