Exemple #1
0
    def update(self, content=None, name=None, category=None, tags=None, **kw):
        f = self.filepath
        content = content or f.content
        name = name or self.name

        if category:
            f.remove()  # old
            f = Filepath.from_category(category, name)
            self.category = category
            content = f.content

        if tags:
            content = content.new(tag_names=[t.name for t in tags])
            self.tags = tags
        content.write()

        self.content = content
        self.name = name
        self.mtime = f.mtime
Exemple #2
0
 def filepath(self):
     return Filepath.from_category(self.category, self.name)