Changeset 2929 for lliurex-up/trunk/fuentes/lliurex-up-gui
- Timestamp:
- Nov 24, 2016, 1:23:57 PM (4 years ago)
- Location:
- lliurex-up/trunk/fuentes/lliurex-up-gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-up/trunk/fuentes/lliurex-up-gui/LliurexUpConnect.py
r2925 r2929 34 34 def isLliurexUpIsUpdated(self): 35 35 try: 36 is_lliurexup_update =self.llxUpCore.isLliurexUpIsUpdated()37 return is_lliurexup_update 36 is_lliurexup_updated=self.llxUpCore.isLliurexUpIsUpdated() 37 return is_lliurexup_updated 38 38 39 39 except Exception, e: … … 44 44 def installLliurexUp(self): 45 45 try: 46 #GLib.timeout_add(100,self.is_running)47 #self.t=threading.Thread(target=self.installing)48 #self.t.daemon=True49 #self.t.start()50 46 is_lliurexup_installed=self.llxUpCore.installLliurexUp() 51 47 return is_lliurexup_installed … … 59 55 def check_mirror(self): 60 56 try: 61 is_mirror_update=self.llxUpCore.lliurexMirrorIsUpdated() 62 print is_mirror_update['action'] 63 return is_mirror_update['action'] 57 is_mirror_updated=self.llxUpCore.lliurexMirrorIsUpdated() 58 59 if is_mirror_updated['action']=='update': 60 return False 61 else: 62 return True 64 63 65 64 except Exception, e: … … 92 91 packages_parse=[] 93 92 packages=self.llxUpCore.getPackagesToUpdate() 94 for item in packages: 95 version=packages[item] 96 packages_parse.append(item+";"+version['candidate']+";"+'20Mb') 93 if len(packages)>0: 94 for item in packages: 95 version=packages[item] 96 packages_parse.append(item+";"+version['candidate']+";"+'20Mb') 97 97 98 return packages_parse 98 return packages_parse 99 99 100 100 101 except Exception, e: -
lliurex-up/trunk/fuentes/lliurex-up-gui/lliurex-up.py
r2925 r2929 258 258 self.no_button_box.hide() 259 259 260 self.pbar_label.show()260 #self.pbar_label.show() 261 261 self.pbar.show() 262 262 … … 267 267 msg_gather="<span><b>"+_("Checking for new version of lliurex-up")+"</b></span>" 268 268 self.gather_label.set_markup(msg_gather) 269 self.updated_percentage(0.15)270 269 GLib.timeout_add(100,self.pulsate_checksystem) 271 270 … … 299 298 300 299 self.response=-1 301 self.spinner.start()300 #self.spinner.start() 302 301 303 302 self.package_list=[] … … 438 437 def pulsate_checksystem(self): 439 438 439 440 440 if not self.check_lliurexup_t.launched: 441 print "Checking lliurex up version" 441 442 self.check_lliurexup_t.start() 442 443 self.check_lliurexup_t.launched=True 443 444 444 445 if self.check_lliurexup_t.done: 445 if not self.is_lliurexup_update and not self.install_lliurexup_t.is_alive():446 if not self.install_lliurexup_t.launched:446 if not self.is_lliurexup_updated: 447 if not self.install_lliurexup_t.is_alive() and not self.install_lliurexup_t.launched: 447 448 print "Updating lliurex-up" 448 449 msg_gather="<span><b>"+_("Updating lliurex-up")+"</b></span>" … … 455 456 msg_gather="<span><b>"+_("Lliurex-up is now updated and will be reboot")+"</b></span>" 456 457 self.gather_label.set_markup(msg_gather) 457 self.updated_percentage(1.0)458 458 t=threading.Thread(target=self.reboot_me) 459 459 t.daemon=True … … 471 471 if self.check_mirror_t.done: 472 472 473 if self.is_mirror_update == 'update':473 if not self.is_mirror_updated: 474 474 print "Asking if mirror will be update" 475 475 476 476 self.yes_button_box.show() 477 477 self.no_button_box.show() 478 msg_gather="<span><b>"+_(" Do you want to create or update your mirror?")+"</b></span>"478 msg_gather="<span><b>"+_("Your mirror is not update.Do you want to update it?")+"</b></span>" 479 479 self.gather_label.set_markup(msg_gather) 480 480 GLib.timeout_add(100,self.pulsate_wait_response) … … 488 488 489 489 if self.check_lliurexup_t.is_alive(): 490 self.pbar.pulse() 490 491 return True 491 492 492 493 if self.install_lliurexup_t.launched: 493 494 if self.install_lliurexup_t.is_alive(): 495 self.pbar.pulse() 494 496 return True 495 497 496 498 if self.check_mirror_t.launched: 497 499 if self.check_mirror_t.is_alive(): 500 self.pbar.pulse() 498 501 return True 499 502 … … 508 511 509 512 510 self.is_lliurexup_update =self.llxup_connect.isLliurexUpIsUpdated() #Call to the function to get the version of lliurex-up513 self.is_lliurexup_updated=self.llxup_connect.isLliurexUpIsUpdated() 511 514 self.check_lliurexup_t.done=True 512 515 … … 520 523 def check_mirror(self): 521 524 522 self.is_mirror_update =self.llxup_connect.check_mirror()525 self.is_mirror_updated=self.llxup_connect.check_mirror() 523 526 self.check_mirror_t.done=True 524 527 … … 536 539 537 540 if self.response==1: 541 self.pbar_label.show() 542 self.updated_percentage(0) 543 self.spinner.start() 538 544 self.yes_button_box.hide() 539 545 self.no_button_box.hide() … … 541 547 self.gather_label.set_markup(msg_gather) 542 548 self.execute_lliurexmirror_t.start() 543 GLib.timeout_add(100 ,self.pulsate_updating_mirror)549 GLib.timeout_add(1000,self.pulsate_updating_mirror) 544 550 545 551 return False 546 552 553 self.pbar.pulse() 547 554 return True 548 555 … … 557 564 558 565 else: 559 GLib.timeout_add(100,self.pulsate_get_info) 566 self.spinner.stop() 567 self.pbar_label.hide() 568 GLib.timeout_add(1000,self.pulsate_get_info) 560 569 return False 561 570 … … 565 574 566 575 def pulsate_get_info(self): 567 576 577 self.pbar.pulse() 568 578 if not self.gather_packages_t.is_alive() and not self.gather_packages_t.launched: 569 579 print "Gather packages" … … 578 588 self.gather_label.set_markup(msg_gather) 579 589 self.pbar.hide() 580 self.pbar_label.hide()581 self.spinner.stop()582 590 self.cancel_button_box.show() 583 591 print "Sytem update. Nothing to do" … … 590 598 self.pbar.hide() 591 599 self.pbar_label.hide() 592 self.spinner.stop()593 600 self.stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT) 594 601 self.stack.set_visible_child_name("update") … … 631 638 632 639 def updated_percentage(self,completed): 633 634 self.pbar.set_fraction(completed) 635 self.per=completed 636 637 value=completed*100 638 value=format(value,'.2f') 639 640 msg_percentage="<span><b>"+value+"%"+"</b></span>" 640 641 percentage=completed/100.0 642 self.pbar.set_fraction(percentage) 643 644 msg_value=format(completed,'.0f') 645 646 msg_percentage="<span><b>"+msg_value+"%"+"</b></span>" 641 647 self.pbar_label.set_markup(msg_percentage) 642 648 … … 705 711 self.percentage=0.0 706 712 self.ending_process=0.0 707 self.updated_percentage(0 .0)713 self.updated_percentage(0) 708 714 709 715 self.t=threading.Thread(target=self.execute_scripts,args=()) -
lliurex-up/trunk/fuentes/lliurex-up-gui/rsrc/lliurex-up.ui
r2702 r2929 245 245 <property name="can_focus">False</property> 246 246 <property name="margin_bottom">5</property> 247 <property name="label" translatable="yes">label</property>248 247 </object> 249 248 <packing>
Note: See TracChangeset
for help on using the changeset viewer.