def on_source_data_downloaded(self, widget): file = widget.get_downloaded_file() if widget.downloaded: os.system('tar zxf %s -C %s' % (file, consts.CONFIG_ROOT)) self.update_source_data() utdata.save_synced_timestamp(SOURCE_ROOT) self.update_timestamp() elif widget.error: ErrorDialog(_('An error occurred whilst downloading the file')).launch()
def on_app_data_downloaded(self, widget): file = widget.get_downloaded_file() #FIXME if widget.downloaded: os.system('tar zxf %s -C %s' % (file, consts.CONFIG_ROOT)) self.update_app_data() utdata.save_synced_timestamp(APPCENTER_ROOT) self.update_timestamp() elif widget.error: ErrorDialog(_('An error occurred while downloading the file.')).launch()
def on_source_data_downloaded(self, widget): path = widget.get_downloaded_file() tarfile = utdata.create_tarfile(path) if tarfile.is_valid(): tarfile.extract(consts.CONFIG_ROOT) self.update_source_data() utdata.save_synced_timestamp(SOURCE_ROOT) self.update_timestamp() else: ErrorDialog(_('An error occurred whilst downloading the file')).launch()
def on_app_data_downloaded(self, widget): log.debug("on_app_data_downloaded") path = widget.get_downloaded_file() tarfile = utdata.create_tarfile(path) if tarfile.is_valid(): tarfile.extract(consts.CONFIG_ROOT) self.update_app_data() utdata.save_synced_timestamp(APPCENTER_ROOT) self.update_timestamp() else: ErrorDialog(_('An error occurred while downloading the file.')).launch()
def on_source_data_downloaded(self, widget): path = widget.get_downloaded_file() tarfile = utdata.create_tarfile(path) if tarfile.is_valid(): tarfile.extract(consts.CONFIG_ROOT) self.update_source_data() utdata.save_synced_timestamp(SOURCE_ROOT) self.update_timestamp() else: ErrorDialog( _('An error occurred whilst downloading the file')).launch()
def on_sync_button_clicked(self, widget): dialog = CheckSourceDialog(widget.get_toplevel(), self.url) dialog.run() dialog.destroy() if dialog.status == True: dialog = QuestionDialog(_("Update available, Would you like to update?")) response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: dialog = FetchingDialog(parent=self.get_toplevel(), url=get_source_data_url()) dialog.connect('destroy', self.on_source_data_downloaded) dialog.run() dialog.destroy() elif dialog.error == True: ErrorDialog(_("Network Error, Please check your network connection or the remote server is down.")).launch() else: utdata.save_synced_timestamp(SOURCE_ROOT) self.update_timestamp() InfoDialog(_("No update available.")).launch()
def on_sync_button_clicked(self, widget): dialog = CheckUpdateDialog(widget.get_toplevel(), self.url) dialog.run() dialog.destroy() if dialog.status == True: dialog = QuestionDialog(_("Update available, would you like to update?")) response = dialog.run() dialog.destroy() if response == Gtk.ResponseType.YES: dialog = FetchingDialog(get_app_data_url(), self.get_toplevel()) dialog.connect('destroy', self.on_app_data_downloaded) dialog.run() dialog.destroy() elif dialog.error == True: ErrorDialog(_("Network Error, please check your network connection - or the remote server may be down.")).launch() else: utdata.save_synced_timestamp(APPCENTER_ROOT) self.update_timestamp() InfoDialog(_("No update available.")).launch()
def on_sync_button_clicked(self, widget): dialog = CheckSourceDialog(widget.get_toplevel(), self.url) dialog.run() dialog.destroy() if dialog.status == True: dialog = QuestionDialog( _("Update available, Would you like to update?")) response = dialog.run() dialog.destroy() if response == gtk.RESPONSE_YES: dialog = FetchingDialog(parent=self.get_toplevel(), url=get_source_data_url()) dialog.connect('destroy', self.on_source_data_downloaded) dialog.run() dialog.destroy() elif dialog.error == True: ErrorDialog( _("Network Error, Please check your network connection or the remote server is down." )).launch() else: utdata.save_synced_timestamp(SOURCE_ROOT) self.update_timestamp() InfoDialog(_("No update available.")).launch()