def writeHtml(self, doc_id, content): "Set the content of article. The file is html." try: #Fixme: I couldn't convert content to unicode. fd = File(str(doc_id), 'a', 'wb') fd.write(content) fd.close() except Exception as err: msg = "We couldn't write %s" % doc_id loggero().error('Article.write %s' % msg) loggero().error(repr(err))
def save(self): json_dump = json.dumps(self.json) fd = File('', 'i', 'w') fd.write(json_dump) fd.close()
def save(self): json_dump = json.dumps(self.json) fd = File(self.doc_id, 'c', 'w') fd.write(json_dump) fd.close()