def new_notebook(self, fn, aux=False): " Creates an empty notebook on disc " if os.path.exists(fn): return aux create_notebook_folder(fn) _save_notebook(fn, self.resource.new_notebook) if aux: if aux.get('type') in ('calendar'): nb = get_notebook(fn) nb['_metadata']['raw_date'] = aux.get('raw_date', '') _save_notebook(fn, nb) new_notebook(fn, self.resource)
def writer(self, file): if self.outformat in ('bibnote'): data = self.resource.new_bibliography data['bibliography'] = self.bibliography data['_metadata']['date'] = datetime.datetime.now().strftime(self.resource.time_format) _save_notebook(file, data)
def save_bibnote(self, fn, message): return _save_notebook(message.get('file'), message.get('full_bibliography', ''))
def save_notebook(self, message, fn): " Writes the stipped document content to disc " return _save_notebook(fn, message.get('full_notebook'))