Changeset 3853 for lliurex-remote-installer
- Timestamp:
- Mar 9, 2017, 1:13:43 PM (4 years ago)
- Location:
- lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/AptBox.py
r3851 r3853 70 70 self.set_css_info() 71 71 72 self.c urrent_var=None72 self.core.current_var=None 73 73 self.current_id=None 74 74 … … 125 125 126 126 if not manage_dialog: 127 if self.c urrent_var==None:127 if self.core.current_var==None: 128 128 return False 129 return self.c urrent_var != self.core.var130 131 132 if self.c urrent_var!=None and self.current_var != self.core.var:129 return self.core.current_var != self.core.var 130 131 132 if self.core.current_var!=None and self.core.current_var != self.core.var: 133 133 if not self.changes_detected_dialog(False): 134 134 return True … … 155 155 self.new_apt_button(x) 156 156 157 self.c urrent_var=copy.deepcopy(self.core.var)157 self.core.current_var=copy.deepcopy(self.core.var) 158 158 self.list_box.show_all() 159 159 … … 218 218 if not ignore_changes: 219 219 220 if self.c urrent_var!=None:220 if self.core.current_var!=None: 221 221 if self.check_changes(): 222 222 if not self.changes_detected_dialog(False): … … 224 224 225 225 if apt_id !=self.current_id: 226 self.c urrent_var=copy.deepcopy(self.core.var)226 self.core.current_var=copy.deepcopy(self.core.var) 227 227 228 228 self.current_id=apt_id … … 239 239 self.package_list_box.remove(x) 240 240 241 self.url_entry.set_text(self.c urrent_var["apt"][apt_id]["url"])242 243 for x in self.c urrent_var["apt"][apt_id]["packages"]:241 self.url_entry.set_text(self.core.current_var["apt"][apt_id]["url"]) 242 243 for x in self.core.current_var["apt"][apt_id]["packages"]: 244 244 self.new_package_button("%s"%x) 245 245 … … 250 250 251 251 for apt in self.list_box: 252 if apt.get_tooltip_text() not in self.c urrent_var["apt"]:252 if apt.get_tooltip_text() not in self.core.current_var["apt"]: 253 253 self.list_box.remove(apt) 254 254 255 255 256 256 257 self.core.lri.main_window.connect("delete_event",self.check_changes,True)257 #self.core.lri.main_window.connect("delete_event",self.check_changes,True) 258 258 259 259 … … 283 283 self.core.var["apt"].pop(self.current_id) 284 284 self.current_id=None 285 self.c urrent_var=None285 self.core.current_var=None 286 286 self.core.n4d.set_variable(self.core.var) 287 287 … … 305 305 b=self.new_apt_button(name) 306 306 307 if self.c urrent_var ==None:308 self.c urrent_var=copy.deepcopy(self.core.var)309 310 self.c urrent_var["apt"][name]={}311 self.c urrent_var["apt"][name]["packages"]=[]312 self.c urrent_var["apt"][name]["url"]=source307 if self.core.current_var ==None: 308 self.core.current_var=copy.deepcopy(self.core.var) 309 310 self.core.current_var["apt"][name]={} 311 self.core.current_var["apt"][name]["packages"]=[] 312 self.core.current_var["apt"][name]["url"]=source 313 313 self.new_apt_window.hide() 314 314 315 self.core.var=copy.deepcopy(self.c urrent_var)315 self.core.var=copy.deepcopy(self.core.current_var) 316 316 self.core.n4d.set_variable(self.core.var) 317 317 … … 352 352 self.package_list_box.remove(hbox) 353 353 354 for p in range(len(self.c urrent_var["apt"][self.current_id]["packages"])-1,-1,-1):355 if self.c urrent_var["apt"][self.current_id]["packages"][p]==pkg:356 self.c urrent_var["apt"][self.current_id]["packages"].pop(p)354 for p in range(len(self.core.current_var["apt"][self.current_id]["packages"])-1,-1,-1): 355 if self.core.current_var["apt"][self.current_id]["packages"][p]==pkg: 356 self.core.current_var["apt"][self.current_id]["packages"].pop(p) 357 357 358 358 # STORE VALUE IN N4D HERE IF NEEDED … … 365 365 def url_entry_changed(self,widget): 366 366 367 if self.c urrent_var !=None:367 if self.core.current_var !=None: 368 368 txt=widget.get_text() 369 369 if len(txt)>6: 370 self.c urrent_var["apt"][self.current_id]["url"]=txt370 self.core.current_var["apt"][self.current_id]["url"]=txt 371 371 372 372 #def url_entry_changed … … 382 382 383 383 pkg=pkg.strip(" ") 384 if pkg not in self.c urrent_var["apt"][self.current_id]["packages"]:385 self.c urrent_var["apt"][self.current_id]["packages"].append(pkg)384 if pkg not in self.core.current_var["apt"][self.current_id]["packages"]: 385 self.core.current_var["apt"][self.current_id]["packages"].append(pkg) 386 386 self.new_package_button(pkg) 387 387 … … 424 424 # ######### # 425 425 426 self.core.var=copy.deepcopy(self.c urrent_var)426 self.core.var=copy.deepcopy(self.core.current_var) 427 427 self.test_apt=self.core.n4d.test_apt_list(self.core.var) 428 428 self.thread_ret={"status":True,"msg":"SE HA ROTO"} … … 453 453 self.core.n4d.set_variable(self.test_apt[1]) 454 454 self.core.var=copy.deepcopy(self.test_apt[1]) 455 self.c urrent_var=copy.deepcopy(self.test_apt[1])455 self.core.current_var=copy.deepcopy(self.test_apt[1]) 456 456 else: 457 457 self.core.n4d.set_variable(self.core.var) -
lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/DebBox.py
r3851 r3853 46 46 self.set_css_info() 47 47 48 self.c urrent_var=None48 self.core.current_var=None 49 49 self.current_id=None 50 50 … … 76 76 77 77 self.core.var=info 78 self.c urrent_var=copy.deepcopy(self.core.var)78 self.core.current_var=copy.deepcopy(self.core.var) 79 79 for x in self.core.var["deb"]["packages"]: 80 80 self.new_package_button("%s"%x) 81 81 82 self.core.lri.main_window.connect("delete_event",self.check_changes,True)82 #self.core.lri.main_window.connect("delete_event",self.check_changes,True) 83 83 84 84 #def set_info … … 123 123 pkg=os.path.basename(deb_url) 124 124 #Compruebo si es un paquete nuevo de la lista 125 if pkg not in self.c urrent_var["deb"]["packages"]:126 self.c urrent_var["deb"]["packages"].append(pkg)125 if pkg not in self.core.current_var["deb"]["packages"]: 126 self.core.current_var["deb"]["packages"].append(pkg) 127 127 self.new_package_button(pkg) 128 128 #print "paquete nuevo en lista, esta subido??" 129 129 #Compruebo que es accesible via apache, sino lo apunto para copiar cuando aplique. 130 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.c urrent_var["deb"]["url"])130 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.core.current_var["deb"]["url"]) 131 131 if not exist_in_server[0]: 132 132 #print "No existe este deb lo debo de subir" … … 157 157 158 158 if not manage_dialog: 159 if self.c urrent_var==None:159 if self.core.current_var==None: 160 160 return False 161 return self.c urrent_var != self.core.var161 return self.core.current_var != self.core.var 162 162 163 163 164 if self.c urrent_var!=None and self.current_var != self.core.var:164 if self.core.current_var!=None and self.core.current_var != self.core.var: 165 165 if not self.changes_detected_dialog(False): 166 166 return True … … 212 212 self.package_list_box.remove(hbox) 213 213 214 for p in range(len(self.c urrent_var["deb"]["packages"])-1,-1,-1):215 if self.c urrent_var["deb"]["packages"][p]==pkg:216 self.c urrent_var["deb"]["packages"].pop(p)214 for p in range(len(self.core.current_var["deb"]["packages"])-1,-1,-1): 215 if self.core.current_var["deb"]["packages"][p]==pkg: 216 self.core.current_var["deb"]["packages"].pop(p) 217 217 #Compruebo que es accesible via apache, y pregunto si lo borro tambien del servidor 218 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.c urrent_var["deb"]["url"])218 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.core.current_var["deb"]["url"]) 219 219 if exist_in_server[0]: 220 220 if self.remove_file_dialog(pkg): … … 262 262 self.package_list_box.remove(c) 263 263 264 for x in self.c urrent_var["deb"]["packages"]:264 for x in self.core.current_var["deb"]["packages"]: 265 265 self.new_package_button("%s"%x) 266 266 if self.deleted[0]: 267 self.core.var=copy.deepcopy(self.c urrent_var)267 self.core.var=copy.deepcopy(self.core.current_var) 268 268 self.core.n4d.set_variable(self.core.var) 269 269 … … 306 306 pkg=deb[0] 307 307 deb_url=deb[1] 308 if self.c urrent_var["deb"]["url"] in [None,"",[]]:309 self.c urrent_var["deb"]["url"]="http://server/llx-remote/"310 url_dest=self.c urrent_var["deb"]["url"].split('http://server/')[1]308 if self.core.current_var["deb"]["url"] in [None,"",[]]: 309 self.core.current_var["deb"]["url"]="http://server/llx-remote/" 310 url_dest=self.core.current_var["deb"]["url"].split('http://server/')[1] 311 311 url_dest="/var/www/"+str(url_dest) 312 312 self.core.n4d.send_file("server",deb_url,url_dest) … … 315 315 self.list_new_debs=[] 316 316 self.core.dprint("Applying changes...") 317 self.core.var=copy.deepcopy(self.c urrent_var)317 self.core.var=copy.deepcopy(self.core.current_var) 318 318 self.test_deb=self.core.n4d.test_deb_list(self.core.var) 319 319 self.thread_ret={"status":True,"msg":"SE HA ROTO"} … … 340 340 self.core.n4d.set_variable(self.test_deb[1]) 341 341 self.core.var=copy.deepcopy(self.test_deb[1]) 342 self.c urrent_var=copy.deepcopy(self.test_deb[1])342 self.core.current_var=copy.deepcopy(self.test_deb[1]) 343 343 else: 344 344 self.core.var["deb"]["url"]="http://server/llx-remote/" -
lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/ExecBox.py
r3851 r3853 46 46 self.set_css_info() 47 47 48 self.c urrent_var=None48 self.core.current_var=None 49 49 self.current_id=None 50 50 … … 76 76 77 77 self.core.var=info 78 self.c urrent_var=copy.deepcopy(self.core.var)78 self.core.current_var=copy.deepcopy(self.core.var) 79 79 for x in self.core.var["sh"]["packages"]: 80 80 self.new_package_button("%s"%x) 81 81 82 self.core.lri.main_window.connect("delete_event",self.check_changes,True) 83 82 84 83 #def set_info 85 84 … … 123 122 pkg=os.path.basename(exec_url) 124 123 #Compruebo si es un paquete nuevo de la lista 125 if pkg not in self.c urrent_var["sh"]["packages"]:126 self.c urrent_var["sh"]["packages"].append(pkg)124 if pkg not in self.core.current_var["sh"]["packages"]: 125 self.core.current_var["sh"]["packages"].append(pkg) 127 126 self.new_package_button(pkg) 128 127 #print "paquete nuevo en lista, esta subido??" 129 128 #Compruebo que es accesible via apache, sino lo apunto para copiar cuando aplique. 130 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.c urrent_var["sh"]["url"])129 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.core.current_var["sh"]["url"]) 131 130 if not exist_in_server[0]: 132 131 #print "No existe este exec lo debo de subir" … … 136 135 137 136 # ###### # 138 #print self.c urrent_var137 #print self.core.current_var 139 138 #print self.core.var 140 139 return True … … 157 156 def check_changes(self,widget=True,event=True,manage_dialog=False): 158 157 158 159 159 if not manage_dialog: 160 if self.c urrent_var==None:160 if self.core.current_var==None: 161 161 return False 162 return self.c urrent_var != self.core.var162 return self.core.current_var != self.core.var 163 163 164 164 165 if self.c urrent_var!=None and self.current_var != self.core.var:165 if self.core.current_var!=None and self.core.current_var != self.core.var: 166 166 if not self.changes_detected_dialog(False): 167 167 return True … … 213 213 self.package_list_box.remove(hbox) 214 214 215 for p in range(len(self.c urrent_var["sh"]["packages"])-1,-1,-1):216 if self.c urrent_var["sh"]["packages"][p]==pkg:217 self.c urrent_var["sh"]["packages"].pop(p)215 for p in range(len(self.core.current_var["sh"]["packages"])-1,-1,-1): 216 if self.core.current_var["sh"]["packages"][p]==pkg: 217 self.core.current_var["sh"]["packages"].pop(p) 218 218 #Compruebo que es accesible via apache, y pregunto si lo borro tambien del servidor 219 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.c urrent_var["sh"]["url"])219 exist_in_server=self.core.n4d.app_deb_exist(pkg, self.core.current_var["sh"]["url"]) 220 220 if exist_in_server[0]: 221 221 if self.remove_file_dialog(pkg): … … 263 263 self.package_list_box.remove(c) 264 264 265 for x in self.c urrent_var["sh"]["packages"]:265 for x in self.core.current_var["sh"]["packages"]: 266 266 self.new_package_button("%s"%x) 267 267 if self.deleted[0]: 268 self.core.var=copy.deepcopy(self.c urrent_var)268 self.core.var=copy.deepcopy(self.core.current_var) 269 269 self.core.n4d.set_variable(self.core.var) 270 270 … … 309 309 pkg=sh[0] 310 310 exec_url=sh[1] 311 if self.c urrent_var["sh"]["url"] in [None,"",[]]:312 self.c urrent_var["sh"]["url"]="http://server/llx-remote/"313 url_dest=self.c urrent_var["sh"]["url"].split('http://server/')[1]311 if self.core.current_var["sh"]["url"] in [None,"",[]]: 312 self.core.current_var["sh"]["url"]="http://server/llx-remote/" 313 url_dest=self.core.current_var["sh"]["url"].split('http://server/')[1] 314 314 url_dest="/var/www/"+str(url_dest) 315 315 response=self.core.n4d.send_file("server",exec_url,url_dest) … … 317 317 if not response: 318 318 self.not_sended_execs.append(pkg) 319 self.c urrent_var["sh"]["packages"].remove(pkg)319 self.core.current_var["sh"]["packages"].remove(pkg) 320 320 321 321 #Inicializo de nuevo la lista de paquetes, ya esta subido todo lo que se queria. … … 324 324 325 325 self.core.dprint("Applying changes...") 326 self.test_exec=self.core.n4d.test_list(self.c urrent_var,'sh')327 self.core.var=copy.deepcopy(self.c urrent_var)326 self.test_exec=self.core.n4d.test_list(self.core.current_var,'sh') 327 self.core.var=copy.deepcopy(self.core.current_var) 328 328 self.thread_ret={"status":True,"msg":"SE HA ROTO"} 329 329 … … 349 349 self.core.n4d.set_variable(self.test_exec[1]) 350 350 self.core.var=copy.deepcopy(self.test_exec[1]) 351 self.c urrent_var=copy.deepcopy(self.test_exec[1])351 self.core.current_var=copy.deepcopy(self.test_exec[1]) 352 352 else: 353 353 self.core.var["sh"]["url"]="http://server/llx-remote/" … … 373 373 374 374 print "1111111" 375 print self.c urrent_var375 print self.core.current_var 376 376 print self.core.var 377 if self.core.var!=self.c urrent_var:377 if self.core.var!=self.core.current_var: 378 378 print "distintos" 379 379 else: -
lliurex-remote-installer/trunk/fuentes/lliurex-remote-installer-gui.install/usr/share/lliurex-remote-installer/LliurexRemoteInstaller.py
r3851 r3853 8 8 9 9 import Core 10 import Dialog 11 import sys 10 12 11 13 signal.signal(signal.SIGINT, signal.SIG_DFL) … … 112 114 self.debs_button.connect("clicked",self.debs_button_clicked) 113 115 self.exes_button.connect("clicked",self.exes_button_clicked) 116 self.main_window.connect("delete_event",self.check_changes) 114 117 115 118 #def connect_signals 119 120 def check_changes(self,widget,event): 121 122 if self.core.current_var!=None and self.core.current_var != self.core.var: 123 if not self.changes_detected_dialog(): 124 return True 125 126 sys.exit(0) 127 128 #def check_changes 129 130 131 def changes_detected_dialog(self): 132 133 134 dialog=Dialog.QuestionDialog(self.main_window,"Changes detected","There are unsaved changes. Do you want to discard them?") 135 response=dialog.run() 136 dialog.destroy() 137 138 if response== Gtk.ResponseType.OK: 139 return True 140 141 return False 142 143 #def changes_detected_dialog 144 145 116 146 117 147 def start_gui(self):
Note: See TracChangeset
for help on using the changeset viewer.