Exemplo n.º 1
0
 def exportText(self, client, filename):
     filename = Path(filename)
     log.debug(u"exportWebsite, filename=%s" % filename)
     if not filename.ext.lower() == '.txt': 
         filename += '.txt'
     if filename.exists(): 
         filename.remove()
     textExport = TextExport(filename)
     textExport.export(self.package)
     client.alert(_(u'Exported to %s') % filename)
Exemplo n.º 2
0
 def exportText(self, client, filename):
     try:
         filename = Path(filename)
         log.debug(u"exportWebsite, filename=%s" % filename)
         if not filename.lower().endswith('.txt'):
             filename += '.txt'
             if Path(filename).exists():
                 msg = _(u'"%s" already exists.\nPlease try again with a different filename') % filename
                 client.alert(_(u'EXPORT FAILED!\n%s' % msg))
                 return
         textExport = TextExport(filename)
         textExport.export(self.package)
     except Exception, e:
         client.alert(_('EXPORT FAILED!\n%s' % str(e)))
         raise
 def exportText(self, client, filename):
     try:
         filename = Path(filename)
         log.debug(u"exportWebsite, filename=%s" % filename)
         # Append an extension if required
         if not filename.lower().endswith('.txt'):
             filename += '.txt'
             if Path(filename).exists():
                 msg = _(
                     u'"%s" already exists.\nPlease try again with a different filename'
                 ) % filename
                 client.alert(_(u'EXPORT FAILED!\n%s' % msg))
                 return
         # Do the export
         textExport = TextExport(filename)
         textExport.export(self.package)
     except Exception, e:
         client.alert(_('EXPORT FAILED!\n%s' % str(e)))
         raise
Exemplo n.º 4
0
 def export_text(self, pkg, outputf):
     textExport = TextExport(outputf)
     textExport.export(pkg)
     textExport.save(outputf)
Exemplo n.º 5
0
 def export_text(self, pkg, outputf):
     textExport =TextExport(outputf)
     textExport.export(pkg)
     textExport.save(outputf)