Beispiel #1
0
    def event_export(self, widget):
        dlg = mcm.gui.widgets.FileSelectDialog(True)
        dlg.run()

        if dlg.response == gtk.RESPONSE_OK and dlg.mime == 'html':
            _html = Html(constants.version, self.connections)
            _html.export(dlg.get_filename())
            mcm.gui.widgets.show_info_dialog(
                constants.export_finished,
                constants.saved_file % dlg.get_filename())
        elif dlg.response == gtk.RESPONSE_OK and dlg.mime == 'csv':
            _csv = mcm.common.utils.export_csv(self.connections,
                                               dlg.get_filename())
            mcm.gui.widgets.show_info_dialog(
                constants.export_finished,
                constants.saved_file % dlg.get_filename())
        elif dlg.response == gtk.RESPONSE_OK and dlg.mime == 'mcm':
            export_dialog = mcm.gui.dialogs.crypto.MCMCryptoDialog(
                dlg.get_filename(), None)
            export_dialog.run()
            if export_dialog.response == gtk.RESPONSE_OK:
                mcm.gui.widgets.show_info_dialog(
                    constants.export_finished,
                    constants.saved_file % dlg.get_filename())
 def export_html(self):
     from mcm.common.export import Html
     _html = Html(constants.version, self.connections)
     _html.export()