- Timestamp:
- May 8, 2017, 11:40:30 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-up/trunk/fuentes/lliurex-up/usr/share/lliurex-up/lliurex-up.py
r4506 r4619 119 119 self.islliurexup_running() 120 120 self.check_root() 121 self.free_space_check()121 #self.free_space_check() 122 122 self.llxup_connect=LliurexUpConnect.LliurexUpConnect() 123 123 #print " [Lliurex-up]: Checking metapackage" … … 156 156 157 157 if ((os.statvfs("/").f_bfree * os.statvfs("/").f_bsize) / (1024*1024*1024)) < 2: #less than 2GB available? 158 return False 159 ''' 158 160 md = Gtk.MessageDialog(None, 0,Gtk.MessageType.ERROR, Gtk.ButtonsType.CANCEL," Lliurex UP") 159 161 md.format_secondary_text(_("There's not enough space on disk to upgrade (2 GB needed)")) … … 161 163 md.destroy() 162 164 sys.exit(1) 165 ''' 166 else: 167 return True 163 168 164 169 # def free_space_check … … 576 581 #self.pbar.pulse() 577 582 583 abort=False 578 584 if not self.initactions_process_t.launched: 579 585 print " [Lliurex-up]: Checking system: connection to lliurex.net and init-actions" … … 588 594 589 595 if self.initactions_process_t.done: 590 if self.statusN4d: 591 if self.can_connect: 592 #is_mirror_running_inserver=self.llxup_connect.clientCheckingMirrorIsRunning() 593 if self.is_mirror_running_inserver==False: 594 595 if not self.check_lliurexup_t.is_alive() and not self.check_lliurexup_t.launched: 596 print " [Lliurex-up]: Checking Lliurex-up version" 597 msg_gather="<span><b>"+_("Looking for new version of LliureX Up")+"</b></span>" 598 self.gather_label.set_markup(msg_gather) 599 self.check_lliurexup_t.start() 600 self.check_lliurexup_t.launched=True 601 self.show_number_process_executing(2,"") 602 603 604 if self.check_lliurexup_t.done: 605 if not self.is_lliurexup_updated: 606 if not self.install_lliurexup_t.is_alive() and not self.install_lliurexup_t.launched: 607 print " [Lliurex-up]: Updating Lliurex-up" 608 msg_gather="<span><b>"+_("Updating LliureX Up")+"</b></span>" 609 self.gather_label.set_markup(msg_gather) 610 self.install_lliurexup_t.start() 611 self.install_lliurexup_t.launched=True 612 self.show_number_process_executing(3,"") 613 596 if self.free_space: 597 if self.statusN4d: 598 if self.can_connect: 599 #is_mirror_running_inserver=self.llxup_connect.clientCheckingMirrorIsRunning() 600 if self.is_mirror_running_inserver==False: 601 602 if not self.check_lliurexup_t.is_alive() and not self.check_lliurexup_t.launched: 603 print " [Lliurex-up]: Checking Lliurex-up version" 604 msg_gather="<span><b>"+_("Looking for new version of LliureX Up")+"</b></span>" 605 self.gather_label.set_markup(msg_gather) 606 self.check_lliurexup_t.start() 607 self.check_lliurexup_t.launched=True 608 self.show_number_process_executing(2,"") 609 610 611 if self.check_lliurexup_t.done: 612 if not self.is_lliurexup_updated: 613 if not self.install_lliurexup_t.is_alive() and not self.install_lliurexup_t.launched: 614 print " [Lliurex-up]: Updating Lliurex-up" 615 msg_gather="<span><b>"+_("Updating LliureX Up")+"</b></span>" 616 self.gather_label.set_markup(msg_gather) 617 self.install_lliurexup_t.start() 618 self.install_lliurexup_t.launched=True 619 self.show_number_process_executing(3,"") 620 621 else: 622 if self.install_lliurexup_t.done: 623 print " [Lliurex-up]: Reboot Lliurex-up" 624 #msg_gather="<span><b>"+_("Lliurex-up is now updated and will be reboot")+"</b></span>" 625 #self.pbar.hide() 626 #self.gather_label.set_markup(msg_gather) 627 #self.t=threading.Thread(target=self.reboot_lliurexup) 628 self.pbar_label.hide() 629 self.msg_wait="<span><b>"+_("LliureX Up is now updated and will be reboot in %s seconds...")+"</b></span>" 630 GLib.timeout_add(10,self.wait_to_reboot) 631 #self.t.daemon=True 632 #self.t.start() 633 return False 614 634 else: 615 if self.install_lliurexup_t.done: 616 print " [Lliurex-up]: Reboot Lliurex-up" 617 #msg_gather="<span><b>"+_("Lliurex-up is now updated and will be reboot")+"</b></span>" 618 #self.pbar.hide() 619 #self.gather_label.set_markup(msg_gather) 620 #self.t=threading.Thread(target=self.reboot_lliurexup) 621 self.pbar_label.hide() 622 self.msg_wait="<span><b>"+_("LliureX Up is now updated and will be reboot in %s seconds...")+"</b></span>" 623 GLib.timeout_add(10,self.wait_to_reboot) 624 #self.t.daemon=True 625 #self.t.start() 626 return False 635 if not self.check_mirror_t.is_alive() and not self.check_mirror_t.launched: 636 print " [Lliurex-up]: Checking if mirror exist" 637 msg_gather="<span><b>"+_("Checking if mirror exist and there is updated")+"</b></span>" 638 self.gather_label.set_markup(msg_gather) 639 self.check_mirror_t.start() 640 self.check_mirror_t.launched=True 641 self.show_number_process_executing(4,"") 642 643 644 645 if self.check_mirror_t.done: 646 is_mirror_running=self.llxup_connect.lliurexMirrorIsRunning() 647 648 if not self.is_mirror_updated: 649 if not is_mirror_running: 650 print " [Lliurex-up]: Asking if mirror will be update" 651 self.yes_button_box.show() 652 self.no_button_box.show() 653 self.pbar.hide() 654 self.pbar_label.hide() 655 #self.spinner.stop() 656 msg_gather="<span><b>"+_("Your mirror is not update. Do you want to update it?")+"</b></span>" 657 self.gather_label.set_markup(msg_gather) 658 #GLib.timeout_add(100,self.pulsate_wait_response) 659 return False 660 661 else: 662 self.mirror_running_msg() 663 return False 664 665 else: 666 if is_mirror_running: 667 self.mirror_running_msg() 668 return False 669 else: 670 print " [Lliurex-up]: Nothing to do with mirror" 671 GLib.timeout_add(100,self.pulsate_get_info) 672 return False 673 674 else: 675 abort=True 676 ''' 677 self.spinner.stop() 678 self.pbar.hide() 679 self.pbar_label.hide() 680 self.cancel_button_box.show() 681 self.gather_label.set_name("ERROR_FONT") 682 ''' 683 if self.is_mirror_running_inserver: 684 msg_gather="<span><b>"+_("Mirror is being updated in server. Unable to update the system")+"</b></span>" 685 print " [Lliurex-up]: Mirror is being updated in server" 627 686 else: 628 if not self.check_mirror_t.is_alive() and not self.check_mirror_t.launched: 629 print " [Lliurex-up]: Checking if mirror exist" 630 msg_gather="<span><b>"+_("Checking if mirror exist and there is updated")+"</b></span>" 631 self.gather_label.set_markup(msg_gather) 632 self.check_mirror_t.start() 633 self.check_mirror_t.launched=True 634 self.show_number_process_executing(4,"") 635 636 637 638 if self.check_mirror_t.done: 639 is_mirror_running=self.llxup_connect.lliurexMirrorIsRunning() 640 641 if not self.is_mirror_updated: 642 if not is_mirror_running: 643 print " [Lliurex-up]: Asking if mirror will be update" 644 self.yes_button_box.show() 645 self.no_button_box.show() 646 self.pbar.hide() 647 self.pbar_label.hide() 648 #self.spinner.stop() 649 msg_gather="<span><b>"+_("Your mirror is not update. Do you want to update it?")+"</b></span>" 650 self.gather_label.set_markup(msg_gather) 651 #GLib.timeout_add(100,self.pulsate_wait_response) 652 return False 653 654 else: 655 self.mirror_running_msg() 656 return False 657 658 else: 659 if is_mirror_running: 660 self.mirror_running_msg() 661 return False 662 else: 663 print " [Lliurex-up]: Nothing to do with mirror" 664 GLib.timeout_add(100,self.pulsate_get_info) 665 return False 666 687 msg_gather="<span><b>"+_("Unable to connect with server")+"</b></span>" 688 print " [Lliurex-up]: Unable to connect with server" 689 690 691 #self.gather_label.set_markup(msg_gather) 692 #return False 693 694 667 695 else: 696 abort=True 697 ''' 668 698 self.spinner.stop() 669 699 self.pbar.hide() … … 671 701 self.cancel_button_box.show() 672 702 self.gather_label.set_name("ERROR_FONT") 673 if self.is_mirror_running_inserver: 674 msg_gather="<span><b>"+_("Mirror is being updated in server. Unable to update the system")+"</b></span>" 675 else: 676 msg_gather="<span><b>"+_("Unable to connect with server")+"</b></span>" 677 678 self.gather_label.set_markup(msg_gather) 679 return False 680 703 ''' 704 msg_gather="<span><b>"+_("Unable to connect to lliurex.net")+"</b></span>" 705 #self.gather_label.set_markup(msg_gather) 706 print " [Lliurex-up]: Unable to connect to lliurex.net" 707 #return False 681 708 682 709 else: 710 abort=True 711 ''' 683 712 self.spinner.stop() 684 713 self.pbar.hide() … … 686 715 self.cancel_button_box.show() 687 716 self.gather_label.set_name("ERROR_FONT") 688 msg_gather="<span><b>"+_("Unable to connect to lliurex.net")+"</b></span>"689 self.gather_label.set_markup(msg_gather)690 print " [Lliurex-up]: Unable to connect to lliurex.net"691 return False692 717 ''' 718 msg_gather="<span><b>"+_('N4d is not working. Restart the service and try againg')+"</b></span>" 719 #self.gather_label.set_markup(msg_gather) 720 print " [Lliurex-up]: N4d is not working" 721 #return False 693 722 else: 694 self.spinner.stop() 695 self.pbar.hide() 696 self.pbar_label.hide() 697 self.cancel_button_box.show() 698 self.gather_label.set_name("ERROR_FONT") 699 msg_gather="<span><b>"+_('N4d is not working. Restart the service and try againg')+"</b></span>" 700 self.gather_label.set_markup(msg_gather) 701 print " [Lliurex-up]: N4d is not working" 702 return False 703 723 abort=True 724 msg_gather="<span><b>"+_("There's not enough space on disk to upgrade (2 GB needed)")+"</b></span>" 725 print " [Lliurex-up]: Not enough space on disk" 726 727 if abort: 728 self.spinner.stop() 729 self.pbar.hide() 730 self.pbar_label.hide() 731 self.cancel_button_box.show() 732 self.gather_label.set_name("ERROR_FONT") 733 self.gather_label.set_markup(msg_gather) 734 return False 735 736 704 737 if self.initactions_process_t.is_alive(): 705 738 return True … … 740 773 def initActions_process(self): 741 774 time.sleep(5) 742 self.statusN4d=self.llxup_connect.checkInitialN4dStatus() 743 if self.statusN4d: 744 self.llxup_connect.checkInitialFlavour() 745 self.can_connect=self.llxup_connect.canConnectToLliurexNet() 746 if self.can_connect: 747 self.is_mirror_running_inserver=self.llxup_connect.clientCheckingMirrorIsRunning() 748 self.llxup_connect.initActionsScript() 775 self.free_space=self.free_space_check() 776 if self.free_space: 777 self.statusN4d=self.llxup_connect.checkInitialN4dStatus() 778 if self.statusN4d: 779 self.llxup_connect.checkInitialFlavour() 780 self.can_connect=self.llxup_connect.canConnectToLliurexNet() 781 if self.can_connect: 782 self.is_mirror_running_inserver=self.llxup_connect.clientCheckingMirrorIsRunning() 783 self.llxup_connect.initActionsScript() 749 784 750 785 self.initactions_process_t.done=True
Note: See TracChangeset
for help on using the changeset viewer.