Exemplo n.º 1
0
 def show_option_list(self):
     print('*'*30)
     print(':: Android Builder ::')
     print('*'*30)
     print('\nSelect an option:')
     print('\t1: Build application')
     print('\t2: Custom build')
     print('\t3: Run application')
     print('\t4: Refresh build')
     print('\t5: Exit')
     choice = None
     while choice != 5:
         choice = input('Enter a choice [1-5]: ')
         try:
             choice = int(choice)
         except ValueError:
             Print.printRed(f"INVALID CHOICE: '{choice}'")
             continue
        
         # Manipulate user choice
         if choice == 1: # Build application
             os.system('clear')
             self.build_application()
             break
     
         elif choice == 2:
             pass
         elif choice == 3:
             pass
         elif choice == 4:
             pass
         elif choice == 5: # Exit
             continue
         else:
             print(f"INVALID CHOICE: '{choice}'")
Exemplo n.º 2
0
 def print_task_end(self, task, process):
     if process.returncode != 0: 
         # Command was unsuccessful
         print("\n" + process.stdout + process.stderr)
         Print.printRed(f'  > [{task}]... FAIL')
         print('*'*30)
         return False
     elif not (process.stdout + process.stderr).strip():
         # Command was successful but did not produced any output
          Print.printGreen(' OK')
     else:
         # Command was successful but produced some output
         print("\n\n" + process.stdout + process.stderr)
         Print.printGreen(f'  > [{task}]... OK')
     return True