def check_apply_thread(self, dialog): if self.thread.is_alive(): return True dialog.destroy() #Se pudo testear la lista de debs, es un [True,dict,list_debs_ok,list_debs_fail] if self.test_deb[0]: if self.test_deb[3] not in [None, "", "[]", []]: if self.delete_test_deb_dialog(self.test_deb[3]): self.core.n4d.set_variable(self.test_deb[1]) self.core.var = copy.deepcopy(self.test_deb[1]) self.core.current_var = copy.deepcopy(self.test_deb[1]) else: self.core.var["deb"]["url"] = "http://server/llx-remote/" self.core.n4d.set_variable(self.core.var) else: self.core.var["deb"]["url"] = "http://server/llx-remote/" self.core.n4d.set_variable(self.core.var) else: self.core.dprint("Error en el test, no se guarda la variable") self.set_info(self.core.var) self.core.dprint("Done") if not self.thread_ret["status"]: mw = self.core.lri.main_window d = Dialog.ErrorDialog(mw, "", self.thread_ret["msg"]) d.run() d.destroy() return False
def check_apply_thread(self, dialog): if self.thread.is_alive(): return True dialog.destroy() #self.test_apt=[True,False, n4d_var, listado_apt_accesibles, listado_apt_no_instalbles, comentario] if self.test_apt[0]: if self.test_apt[3] not in [None, "", "[]", []]: if self.delete_test_apt_dialog(self.test_apt[3]): self.core.n4d.set_variable(self.test_apt[1]) self.core.var = copy.deepcopy(self.test_apt[1]) self.core.current_var = copy.deepcopy(self.test_apt[1]) else: self.core.n4d.set_variable(self.core.var) else: self.core.n4d.set_variable(self.core.var) self.core.dprint("Done") else: self.core.dprint("Test Error: variable remains unset") for b in self.list_box: if b.get_tooltip_text() == self.current_id: break self.apt_clicked(b, self.current_id) if not self.thread_ret["status"]: mw = self.core.lri.main_window d = Dialog.ErrorDialog(mw, "", self.thread_ret["msg"]) d.run() d.destroy() return False
def remove_file_info_dialog(self, comment): main_window = self.core.lri.main_window dialog = Dialog.ErrorDialog(main_window, _("Delete package"), comment) response = dialog.run() dialog.destroy() return True
def error_send_dialog(self, pkg_name): main_window = self.core.lri.main_window dialog = Dialog.ErrorDialog( main_window, _("Sending Package Error"), _("This list %s cannot be sended to server\nPlease review your share directory\n\n/var/www/llx-remote" ) % pkg_name) response = dialog.run() dialog.destroy() return True
def error_repos_dialog(self, repo): comment = ( "%s repositorie not is accesible, please wait to connect with it or select other one" % repo) main_window = self.core.lri.main_window dialog = Dialog.ErrorDialog(main_window, _("Repositories Testing"), comment) response = dialog.run() dialog.destroy() return True
def error_up_dialog(self, pkg_name): main_window = self.core.lri.main_window dialog = Dialog.ErrorDialog( main_window, _("Error in publishing"), _("This %s package can't be uploaded to server.\nPlease review the parameters or inform to LliureX Team." ) % pkg_name) response = dialog.run() dialog.destroy() return True
def error_extension_dialog(self, pkg_name): main_window = self.core.lri.main_window dialog = Dialog.ErrorDialog( main_window, _("Error in Extension"), _("This %s package has not the extension required.\nPlease only DEB packages in this list." ) % pkg_name) response = dialog.run() dialog.destroy() return True
def check_add_zero_button_clicked_thread(self,dialog): if self.thread_zero.is_alive(): return True #if thread ends dialog is destroyed dialog.destroy() self.list_to_organize_elements=[] if self.list_available[0]: for element in self.list_available[1]: for key in element: #Dentro del EPI hay listas, si las hay debo ver todos sus elementos. if element[key]['selection_enabled']['active']: for pkg in element[key]['pkg_list']: clave_name=str(key)+'_'+pkg['name'] epi_name=key pkg_name=pkg['name'] custom_name=pkg['custom_name'] self.generate_list_to_organize_elements(clave_name,epi_name,pkg_name,custom_name) #self.add_element_to_epi_list_dict(clave_name,epi_name,pkg_name,custom_name) #zmd_value=[clave_name,pkg_name,custom_name,epi_name] #self.generate_element_list(zmd_value) #### Ahora tengo que modificar generate element_list y todo lo que conlleva llevando como referencia self.list_available CUIDADO con esto. else: pkg=element[key]['pkg_list'][0] clave_name=str(key)+'_'+pkg['name'] epi_name=key pkg_name=pkg['name'] custom_name=pkg['custom_name'] self.generate_list_to_organize_elements(clave_name,epi_name,pkg_name,custom_name) #self.add_element_to_epi_list_dict(clave_name,epi_name,pkg_name,custom_name) #zmd_value=[clave_name,pkg_name,custom_name,epi_name] #self.generate_element_list(zmd_value) self.organize_elements_and_generate_elements(self.list_to_organize_elements) self.new_zero_window.show() else: #show error dialog #implement self.core.dprint("Test Error: variable remains unset") if not self.thread_ret_zero["status"]: mw=self.core.lri.main_window d=Dialog.ErrorDialog(mw,"",self.thread_ret_zero["msg"]) d.run() d.destroy() return False
def check_apply_thread(self, dialog): if self.thread.is_alive(): return True dialog.destroy() for child in self.update_current_box.get_children(): self.update_current_box.remove(child) self.set_info(self.core.var) self.core.dprint("Done") if not self.thread_ret["status"]: mw = self.core.lri.main_window d = Dialog.ErrorDialog(mw, "", self.thread_ret["msg"]) d.run() d.destroy() return False
def check_apply_thread(self,dialog): if self.thread_changes.is_alive(): return True dialog.destroy() if not self.thread_changes_ret["status"]: mw=self.core.lri.main_window d=Dialog.ErrorDialog(mw,"",self.thread_changes_ret["msg"]) d.run() d.destroy() try: #Si hubo elementos fallidos deberemos eliminar los zomandos que no se puden publicar #Mostramos un mensaje de fallo comunicandolo y preguntamos que hacer. if bool(self.list_epi_deb_failed): delete_epi_list=[] for key in self.list_epi_deb_failed: delete_epi_list.append(key) comment=_("This package list can't be published '%s'\nCan I delete it?")%delete_epi_list #Si se aceptan borrar los zomandos que no se pueden publicar deberemos borrarlos de la box principal y de la secundaria en la current_var if self.error_epi_deb_dialog(comment): for c in self.package_list_box.get_children(): if c.epi in self.list_epi_deb_failed: self.package_list_box.remove(c) del self.core.current_var['epi']['packages'][c.epi] # Una vez borrados podemos actualizar la variabel global. # Daremos un mensaje como que la hemos actualizado. else: #no publicar la variable y dejarla bloqueada hasta que se borren estos paquetes a mano #en la parte de borrado de paquetes deberemos comprobar que esto se ha hecho pass except Exception as e: self.core.dprint("[LliureXRemoteInstaller][ZeroBox](check_apply_thread) Error: %s"%e) return False