def updateArticle(self, id, path): u"""Update the article from *id* and *path*. Set the modification time, so we know when the file is updated.""" data = None wiki = self.readWikiFile(path) if wiki is not None: data = self.compileArticle(wiki) data.id = id data.source = wiki data.ranking = TX.asInt(data.ranking) or 0 # Make sure we can sort on the ranking field. data.blogresponse = TX.asBool(data.blogresponse) data.path = path # Keep the source path is case POST needs to save to the file. data.modificationTime = os.path.getmtime(path) # @@@ TODO: Should be DateTime instance. self.cacheArticle(data) return data
def updateArticle(self, id, path): u"""Update the article from *id* and *path*. Set the modification time, so we know when the file is updated.""" data = None wiki = self.readWikiFile(path) if wiki is not None: data = self.compileArticle(wiki) data.id = id data.source = wiki data.ranking = TX.asInt( data.ranking ) or 0 # Make sure we can sort on the ranking field. data.blogresponse = TX.asBool(data.blogresponse) data.path = path # Keep the source path is case POST needs to save to the file. data.modificationTime = os.path.getmtime( path) # @@@ TODO: Should be DateTime instance. self.cacheArticle(data) return data