def on_help_menu_item_activate(self, widget): temp_dir = self.journal.dirs.temp_dir filesystem.write_file(os.path.join(temp_dir, 'source.txt'), info.help_text) html = self.journal.convert(info.help_text, 'xhtml', headers=[_('RedNotebook Documentation'), info.version, ''], options={'toc': 1}) utils.show_html_in_browser(html, os.path.join(temp_dir, 'help.html'))
def on_help_menu_item_activate(self, widget): temp_dir = self.journal.dirs.temp_dir filesystem.write_file(os.path.join(temp_dir, 'source.txt'), help_text) html = self.journal.convert( help_text, 'xhtml', headers=[_('RedNotebook Documentation'), info.version, ''], options={'toc': 1}) utils.show_html_in_browser(html, os.path.join(temp_dir, 'help.html'))
def on_help_menu_item_activate(self, widget): temp_dir = self.journal.dirs.temp_dir filesystem.write_file(os.path.join(temp_dir, "source.txt"), help_text) html = self.journal.convert( help_text, "xhtml", headers=[_("RedNotebook Documentation"), info.version, ""], options={"toc": 1}, ) utils.show_html_in_browser(html, os.path.join(temp_dir, "help.html"))
def export(self): format = self.exporter.FORMAT if format == 'pdf': self.export_pdf() return export_string = self.get_export_string(format) filesystem.write_file(self.path, export_string) self.journal.show_message(_('Content exported to %s') % self.path)
def save_to_disk(self): assert self.changed() content = '' for key, value in sorted(self.iteritems()): if key not in self.suppressed_keys: content += ('%s=%s\n' % (key, value)) filesystem.write_file(self.file, content) logging.info('Configuration has been saved to disk') self.old_config = self.copy()
def write_documentation(dir): ''' Write the documenation as html to a directory Include the original markup as "source.txt" ''' from rednotebook.util import filesystem from rednotebook.util import markup filesystem.write_file(os.path.join(dir, 'source.txt'), help_text) headers = [_('RedNotebook Documentation'), version, ''] options = {'toc': 1,} html = markup.convert(help_text, 'xhtml', headers, options) filesystem.write_file(os.path.join(dir, 'help.html'), html)
def write_documentation(dir): """ Write the documenation as html to a directory Include the original markup as "source.txt" """ from rednotebook.util import filesystem from rednotebook.util import markup filesystem.write_file(os.path.join(dir, "source.txt"), help_text) headers = [_("RedNotebook Documentation"), version, ""] options = {"toc": 1} html = markup.convert(help_text, "xhtml", headers, options) filesystem.write_file(os.path.join(dir, "help.html"), html)
def write_documentation(dir): ''' Write the documenation as html to a directory Include the original markup as "source.txt" ''' from rednotebook.util import filesystem from rednotebook.util import markup filesystem.write_file(os.path.join(dir, 'source.txt'), help_text) headers = [_('RedNotebook Documentation'), version, ''] options = { 'toc': 1, } html = markup.convert(help_text, 'xhtml', headers, options) filesystem.write_file(os.path.join(dir, 'help.html'), html)
def save_to_disk(self): if not self.changed(): return lines = [] for key, value in sorted(self.iteritems()): if key not in self.suppressed_keys: lines.append("%s=%s" % (key, value)) try: filesystem.make_directory(os.path.dirname(self.filename)) filesystem.write_file(self.filename, "\n".join(lines)) except IOError: logging.error("Configuration could not be saved. Please check " "your permissions") else: logging.info("Configuration has been saved to %s" % self.filename) self.save_state()
def save_to_disk(self): if not self.changed(): return lines = [] for key, value in sorted(self.iteritems()): if key not in self.suppressed_keys: lines.append('%s=%s' % (key, value)) try: filesystem.make_directory(os.path.dirname(self.filename)) filesystem.write_file(self.filename, '\n'.join(lines)) except IOError: logging.error('Configuration could not be saved. Please check ' 'your permissions') else: logging.info('Configuration has been saved to %s' % self.filename) self.save_state()
def save_to_disk(self): if not self.changed(): return content = '' for key, value in sorted(self.iteritems()): if key not in self.suppressed_keys: content += ('%s=%s\n' % (key, value)) try: filesystem.make_directory(os.path.dirname(self.file)) filesystem.write_file(self.file, content) except IOError: logging.error('Configuration could not be saved. Please check ' 'your permissions') return logging.info('Configuration has been saved to %s' % self.file) self.save_state()
def show_html_in_browser(html, filename): filesystem.write_file(filename, html) html_file = os.path.abspath(filename) html_file = 'file://' + html_file webbrowser.open(html_file)
def export(self): format = self.exporter.FORMAT export_string = self.get_export_string(format) filesystem.write_file(self.path, export_string) self.journal.show_message(_("Content exported to %s") % self.path)
def on_save(self, button): template = self.main_window.day_text_field.get_text() filesystem.write_file(self.get_path(self.tmp_title), template)