Beispiel #1
0
    def doExport(self):
        self.writeSettings()
        try:
            if self.settings['sync_path'] == '':
                self.showError(u"A synchronization path must be set first!")
                return

            if not os.path.exists(self.settings['sync_path']):
                self.showError(u"The synchronization path ('%s') is not valid!"
                                % self.settings['sync_path'])
                return

            clear_log_status()
            do_export(
                self.name_to_object[self.settings['interface']],
                self.settings['n_days'],
                self.settings['sync_path'],
                self.progressBar,
                self.settings['extra_factor'],
                self.settings['max_width'],
                self.settings['max_height'],
                self.settings['max_size']
                )
            self.setMobile()
            if check_log_status ():
                self.showWarning(
                    u"Messages were written to log.txt in the "
                    + u"Mnemosyne home directory.")

        except InterfaceError, e:
            self.showError(unicode(e))
Beispiel #2
0
    def doImport(self):
        self.writeSettings()
        try:
            clear_log_status()
            do_import(
                self.name_to_object[self.settings['interface']],
                self.settings['sync_path'],
                self.progressBar)
            self.setLocal()
            rebuild_revision_queue(False)
            self.main_dlg.newQuestion()
            self.main_dlg.updateDialog()
            if check_log_status ():
                self.showWarning(
                    u"Messages were written to log.txt in the "
                    + u"Mnemosyne home directory.")

        except InterfaceError, e:
            self.showError(unicode(e))