Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. import sys
  2. import os
  3. import configparser
  4.  
  5. #menu buffer memory
  6. menu_actions = {}
  7.  
  8. #Str var
  9. soft_lb = "\n"
  10. sof_lbs = "\n\n"
  11. soft_config_file = "config.cfg"
  12. soft_desc = "This little script makes it easy to recover photos on a device connect by adb android."
  13. soft_crea = "Coocke_hunt jonathan.gleyze{AT}gmail{DOT}com"
  14. soft_ver = "1.0"
  15. sof_last_up = "23 janv 2019"
  16.  
  17.  
  18. def main():
  19. os.system('cls')
  20. print("Welcome," + sof_lbs + soft_desc + soft_lb)
  21. print("Creator : " + soft_crea + soft_lb + "Version : " + soft_ver + soft_lb + "Last update : " + sof_last_up + soft_lb + "config : " + soft_config_file)
  22. print("_________________________________________________________________________" + soft_lb)
  23.  
  24. print("1. Get pics")
  25. print("2. Get all the Pics from a file")
  26. print("0. EXIT")
  27. print("_________________________________________________________________________" + soft_lb)
  28. choice = input(soft_lb + " >> ")
  29. exec_menu(choice)
  30.  
  31.  
  32. def exec_menu(choice):
  33. os.system('cls')
  34. ch = choice.lower()
  35. if ch == '':
  36. menu_actions['main']()
  37. else:
  38. try:
  39. menu_actions[ch]()
  40. except KeyError:
  41. print("Invalid selection, please try again."+ soft_lb)
  42. menu_actions['main']()
  43. return
  44.  
  45.  
  46. def get_pics():
  47. print("Recover a photos on the remote device connect by adb" + soft_lb)
  48. print("_________________________________________________________________________" + soft_lb)
  49.  
  50. print("3. Execute")
  51. print("9. Back")
  52. print("0. EXIT")
  53. print("_________________________________________________________________________" + soft_lb)
  54. choice = input(soft_lb + " >> ")
  55. exec_menu(choice)
  56. return
  57.  
  58.  
  59. def exec_on_pics():
  60. print ("remote directory : ")
  61. choice_re = input(soft_lb + " >> ")
  62. current_dir = os.path.dirname(os.path.realpath(__file__))
  63.  
  64. os.system("adb pull " + choice_re + " " + current_dir)
  65. os.system("pause")
  66. return
  67.  
  68.  
  69. def get_pics_file():
  70. print("GPF")
  71. return
  72.  
  73.  
  74. def back():
  75. menu_actions['main_menu']()
  76. return
  77.  
  78.  
  79. def exit():
  80. sys.exit()
  81. return
  82.  
  83.  
  84. menu_actions = {
  85. 'main_menu': main,
  86. '1': get_pics,
  87. '2': get_pics_file,
  88. '3': exec_on_pics,
  89. '9': back,
  90. '0': exit,
  91. }
  92.  
  93. if __name__ == '__main__':
  94. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement