Changeset 2684 for lliurex-up/trunk/fuentes/lliurex-up-gui
- Timestamp:
- Oct 26, 2016, 2:03:04 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-up/trunk/fuentes/lliurex-up-gui/lliurex-up
r2674 r2684 79 79 80 80 def parse_installed_icon(self, icon_file): 81 81 82 image=Gtk.Image() 82 83 image.set_from_file(icon_file) … … 88 89 89 90 def __init__(self): 90 91 91 92 92 self.start_gui() … … 237 237 self.t.daemon=True 238 238 self.t.start() 239 self.no_mirror=False239 240 240 241 241 self.package_list=[] … … 363 363 msg_gather="<span><b>"+_("Checking for new version of lliurex-up")+"</b></span>" 364 364 self.gather_label.set_markup(msg_gather) 365 time.sleep(2) 365 366 367 is_lliurexup_update=False #Call to the function to get the version of lliurex-up 368 time.sleep(1) 369 370 if not is_lliurexup_update: 371 msg_gather="<span><b>"+_("Updating lliurex-up")+"</b></span>" 372 self.gather_label.set_markup(msg_gather) 373 is_lliurexup_updated=True # Call to the function to updates lliurex-up 374 375 while not is_lliurexup_updated: 376 pass 377 378 return True 379 380 else: 381 return True 382 383 #def check_lliurexup_version 384 385 def check_mirror(self): 386 self.response=-1 387 msg_gather="<span><b>"+_("Checking if mirror exist and there is updated")+"</b></span>" 388 self.gather_label.set_markup(msg_gather) 389 390 exist_mirror=False #Call to the function to check mirror 391 time.sleep(1) 392 if not exist_mirror: 393 self.yes_button_box.show() 394 self.no_button_box.show() 395 msg_gather="<span><b>"+_("Do you want to create or update your mirror?")+"</b></span>" 396 self.gather_label.set_markup(msg_gather) 397 398 while self.response==-1: 399 pass 400 401 self.yes_button_box.hide() 402 self.no_button_box.hide() 403 404 if self.response==0: 405 return True 406 407 elif self.response==1: 408 msg_gather="<span><b>"+_("Updating mirror")+"</b></span>" 409 self.gather_label.set_markup(msg_gather) 410 411 is_mirror_updated=True # Call to the function to update mirror 412 time.sleep(1) 413 414 while is_mirror_updated==False: 415 pass 416 366 417 return True 367 368 #def check_lliurexup_version369 370 def check_mirror(self):371 print "Checking mirror"372 self.response=-1373 t=0374 self.yes_button_box.show()375 self.no_button_box.show()376 msg_gather="<span><b>"+_("Do you want to update your mirror?")+"</b></span>"377 self.gather_label.set_markup(msg_gather)378 379 while self.response==-1:380 time.sleep(t)381 t=t+1382 383 self.yes_button_box.hide()384 self.no_button_box.hide()385 return True386 418 387 419 #def check_mirror … … 389 421 def gather_info(self): 390 422 391 self.check_lliurexup_version() 392 self.check_mirror() 393 423 check_lliurexup=self.check_lliurexup_version() 424 check_mirror=self.check_mirror() 425 426 while (not check_lliurexup) & (not check_mirror): 427 pass 394 428 395 429 msg_gather="<span><b>"+_("Checking for new updates")+"</b></span>" 396 430 self.gather_label.set_markup(msg_gather) 397 431 398 #p=subprocess.Popen([cmd],shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)399 #output=p.communicate()400 432 try: 401 433 p1=subprocess.Popen(["llxcfg-upgrade-version-scripts","details"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) … … 498 530 ) 499 531 500 self.update_installed_icon( )532 self.update_installed_icon("epoptes-client") 501 533 502 534 #def execute 503 535 504 536 def install_packages(self,widget, event=None): 537 505 538 self.t=threading.Thread(target=self.execute,args=()) 506 539 self.t.daemon=True … … 518 551 519 552 def get_update_info(self): 553 520 554 self.version_available="16.160916" 521 555 self.version_update="16.160915" … … 538 572 539 573 def pulsate_pbar(self): 574 540 575 if not self.t.is_alive(): 541 576 self.pbar.pulse() … … 546 581 547 582 def view_packages_clicked(self,widget,event): 583 548 584 self.stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT) 549 585 self.stack.set_visible_child_name("packages") … … 554 590 def no_button_clicked(self,widget,event): 555 591 556 self.response= 1592 self.response=0 557 593 558 594 def yes_button_clicked(self,widget,event): 559 560 msg_gather="<span><b>"+_("Updating mirror in progess?")+"</b></span>" 561 self.gather_label.set_markup(msg_gather) 562 self.yes_button_box.hide() 563 self.no_button_box.hide() 564 565 command='/usr/share/lliurex-flavours-selector/lliurex-flavours-selector.py' 566 p=subprocess.Popen([command],shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) 567 output=p.communicate() 568 self.thread_ret=p.returncode 569 self.flavour_error=output[1] 570 571 572 if self.thread_ret==0: 573 self.response=1 595 596 self.response=1 574 597 575 598 #def no_button_clicked 576 599 577 600 def arrow_clicked(self,widget,event): 601 578 602 self.stack.set_transition_type(Gtk.StackTransitionType.SLIDE_RIGHT) 579 603 self.stack.set_visible_child_name("update") … … 581 605 #def arrow_clicked 582 606 583 def update_installed_icon(self): 607 def update_installed_icon(self,pkg_name): 608 584 609 image=Gtk.Image() 585 image.set_from_file( ERROR_ICON)610 image.set_from_file(DONE_ICON) 586 611 icon=image.get_pixbuf() 587 612 588 613 for item in self.packages_store: 589 item[3]=icon 614 name=item[1].split(">")[2] 615 name=name.split("<")[0] 616 if name==pkg_name: 617 item[3]=icon 618 590 619 591 620 #def update_installed_icon
Note: See TracChangeset
for help on using the changeset viewer.