def convert_notebook(self, fname): """Convert an IPython notebook to a Python script in editor""" try: script = nbexporter().from_filename(fname)[0] except Exception as e: QMessageBox.critical(self, _('Conversion error'), _("It was not possible to convert this " "notebook. The error is:\n\n") + \ to_text_string(e)) return self.parent_widget.sig_new_file.emit(script)
def convert_notebook(self, fname): """Convert an IPython notebook to a Python script in editor.""" try: script = nbexporter().from_filename(fname)[0] except Exception as e: msg_box = MessageBoxError( text="It was not possible to convert this " "notebook. The error is:\n\n" + to_text_string(e), title='Conversion error', ) msg_box.exec_() return self.sig_new_file.emit(script)