Esempio n. 1
0
 def previewEntry(self, entry):
     fd, fileName = tempfile.mkstemp('.html')
     self._tempFiles.append(fileName)
     title = entry.title.encode('utf-8')
     text = entry.body.encode('utf-8')
     bodyType = entry.bodyType.encode('utf-8')
     html = renderer.renderPage(title, text, bodyType)
     fp = os.fdopen(fd, 'w')
     try:
         fp.write(html)
     finally:
         fp.close()
     uri = 'file://%s' % fileName
     browserType = self.cfg.getOption('features', 'browser', 'system')
     command = self.cfg.getOption('features', 'browser_cmd', '')
     apputils.openURL(uri, browserType, command)
Esempio n. 2
0
 def previewEntry(self, entry):
     fd, fileName = tempfile.mkstemp('.html')
     self._tempFiles.append(fileName)
     title = entry.title.encode('utf-8')
     text = entry.body.encode('utf-8')
     bodyType = entry.bodyType.encode('utf-8')
     html = renderer.renderPage(title, text, bodyType)
     fp = os.fdopen(fd, 'w')
     try:
         fp.write(html)
     finally:
         fp.close()
     uri = 'file://%s' % fileName
     browserType = self.cfg.getOption('features', 'browser', 'system')
     command = self.cfg.getOption('features', 'browser_cmd', '')
     apputils.openURL(uri, browserType, command)
Esempio n. 3
0
 def showHelpIndex(self):
     fileName = op.join(appconst.PATHS['doc'], 'index.html')
     uri = 'file://%s' % fileName
     browserType = self.cfg.getOption('features', 'browser', 'system')
     command = self.cfg.getOption('features', 'browser_cmd', '')
     apputils.openURL(uri, browserType, command)
Esempio n. 4
0
 def showHelpIndex(self):
     fileName = op.join(appconst.PATHS['doc'], 'index.html')
     uri = 'file://%s' % fileName
     browserType = self.cfg.getOption('features', 'browser', 'system')
     command = self.cfg.getOption('features', 'browser_cmd', '')
     apputils.openURL(uri, browserType, command)