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
def filepath(self): return Filepath.from_category(self.category, self.name)