Example #1
0
    def execute(self):
        filename = self.file_manager.filename
        filename = filename.replace(".gaphor", ".xmi") if filename else "model.xmi"
        file_dialog = FileDialog(
            gettext("Export model to XMI file"), action="save", filename=filename
        )

        filename = file_dialog.selection

        if filename and len(filename) > 0:
            logger.debug(f"Exporting XMI model to: {filename}")
            export = exportmodel.XMIExport(self.element_factory)
            try:
                export.export(filename)
            except Exception as e:
                logger.error(f"Error while saving model to file {filename}: {e}")
Example #2
0
    def execute(self):
        filename = self.file_manager.filename
        filename = filename.replace(".gaphor",
                                    ".xmi") if filename else "model.xmi"
        filename = save_file_dialog(
            gettext("Export model to XMI file"),
            filename=filename,
            extension=".xmi",
            filters=[(gettext("All XMI Files"), ".xmi", "text/xml")],
        )

        if filename and len(filename) > 0:
            logger.debug(f"Exporting XMI model to: {filename}")
            export = exportmodel.XMIExport(self.element_factory)
            try:
                export.export(filename)
            except Exception as e:
                logger.error(
                    f"Error while saving model to file {filename}: {e}")
Example #3
0
    def execute(self):
        filename = self.main_window.get_filename()
        if filename:
            filename = filename.replace(".gaphor", ".xmi")
        else:
            filename = "model.xmi"

        file_dialog = FileDialog(
            _("Export model to XMI file"), action="save", filename=filename
        )

        filename = file_dialog.selection

        if filename and len(filename) > 0:
            logger.debug("Exporting XMI model to: %s" % filename)
            export = exportmodel.XMIExport(self.element_factory)
            try:
                export.export(filename)
            except Exception as e:
                logger.error("Error while saving model to file %s: %s" % (filename, e))
Example #4
0
    def execute(self):
        filename = self.main_window.get_filename()
        if filename:
            filename = filename.replace('.gaphor', '.xmi')
        else:
            filename = 'model.xmi'

        file_dialog = FileDialog(_('Export model to XMI file'),\
                                 action='save',\
                                 filename=filename)

        filename = file_dialog.selection

        if filename and len(filename) > 0:
            log.debug('Exporting XMI model to: %s' % filename)
            export = exportmodel.XMIExport(self.element_factory)
            try:
                export.export(filename)
            except Exception as e:
                log.error('Error while saving model to file %s: %s' %
                          (filename, e))