示例#1
0
 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
示例#2
0
    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
示例#3
0
文件: options.py 项目: ondratu/morias
 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)
示例#4
0
文件: options.py 项目: ondratu/morias
    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
示例#5
0
 def delete(self, req):
     m = driver(req)
     rv = m.delete(self, req)
     write_timestamp(req, req.cfg.redirects_timestamp)
     return rv
示例#6
0
 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
示例#7
0
文件: options.py 项目: ondratu/morias
 def delete(self, req):
     m = driver(req)
     rv = m.delete(self, req)
     write_timestamp(req, req.cfg.options_timestamp)
     return rv
示例#8
0
 def to_parent(self, req):
     rv = super(MenuItem, self).to_parent(req)
     write_timestamp(req, req.cfg.page_menu_timestamp)
     return rv
示例#9
0
 def move(self, req):
     rv = super(MenuItem, self).move(req)
     write_timestamp(req, req.cfg.page_menu_timestamp)
     return rv
示例#10
0
 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
示例#11
0
 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