def mod(self, req): rv = self.__check() if rv: return rv m = driver(req) rv = m.mod(self, req) write_timestamp(req, req.cfg.redirects_timestamp) return rv
def mod(self, req): if not self.name: return EMPTY_FILENAME if not self.check_filename(): return BAD_FILENAME m = driver(req) rv = m.mod(self, req) write_timestamp(req, req.cfg.pages_timestamp) return rv
def add(self, req): if not self.section: return EMPTY_SECTION if not self.option: return EMPTY_OPTION if not self.value: return EMPTY_VALUE m = driver(req) m.add(self, req) write_timestamp(req, req.cfg.options_timestamp)
def set(self, req): if not self.section: return EMPTY_SECTION if not self.option: return EMPTY_OPTION if not self.value: return EMPTY_VALUE cfgs = req.cfg.options.get(self.section, {}).get(self.option, {}).values() if not cfgs: return UNKNOWN_OPTION cls = cfgs[0][1] try: smart_get(self.value, cls) except: return BAD_VALUE m = driver(req) rv = m.option_set(self, req) write_timestamp(req, req.cfg.options_timestamp) return rv
def delete(self, req): m = driver(req) rv = m.delete(self, req) write_timestamp(req, req.cfg.redirects_timestamp) return rv
def set_state(self, req, state): m = driver(req) rv = m.set_state(self, req, state) write_timestamp(req, req.cfg.redirects_timestamp) return rv
def delete(self, req): m = driver(req) rv = m.delete(self, req) write_timestamp(req, req.cfg.options_timestamp) return rv
def to_parent(self, req): rv = super(MenuItem, self).to_parent(req) write_timestamp(req, req.cfg.page_menu_timestamp) return rv
def move(self, req): rv = super(MenuItem, self).move(req) write_timestamp(req, req.cfg.page_menu_timestamp) return rv
def enabled(self, req, enabled=True): self.state = int(enabled) rv = super(MenuItem, self).mod(req, state=self.state) write_timestamp(req, req.cfg.page_menu_timestamp) return rv
def mod(self, req): rv = super(MenuItem, self).mod(req, title=self.title, link=self.link, locale=self.locale) write_timestamp(req, req.cfg.page_menu_timestamp) return rv