Ejemplo n.º 1
0
 def __init__(self, notebook):
     self.lock = notebook.index.lock
     NotebookOperation.__init__(
         self,
         notebook,
         _('Updating index'),  # T: Title of progressbar dialog
         self._get_iter(notebook))
Ejemplo n.º 2
0
    def do_response_ok(self):
        output, exporter = self.get_exporter()
        selection = self.get_selection()
        logger.debug('exporter: %s, selection: %s',
                     exporter.__class__.__name__, selection.__class__.__name__)
        if exporter is None or selection is None:
            logger.debug('Cancelled - selection')
            return False  # canceled

        # Run export
        logging_context = LogContext()
        with logging_context:
            op = NotebookOperation(
                self.ui.notebook,
                _('Exporting notebook'),  # T: Title for progressbar window
                exporter.export_iter(selection))
            dialog = ProgressDialog(self, op)
            dialog.run()

        if op.cancelled:
            return False
        else:
            #~ print '>>> %s E: %i, W: %i' % (
            #~ logging_context.file.path,
            #~ logging_context.handler.n_error, logging_context.handler.n_warning)
            #~ print logging_context.file.read()
            #~ print '---'
            ExportDoneDialog(self, logging_context, output).run()
            return True