reset.py 529 B

123456789101112131415161718
  1. from maix import camera, display, image
  2. image.load_freetype("/root/preset/fonts/simhei.ttf")
  3. hello_img = image.new(size=(320, 240), color=(0, 0, 0), mode="RGB")
  4. hello_img.draw_string(10, 115, 'Reset', scale=1.0, color=(255, 255, 255), thickness=1)
  5. display.show(hello_img)
  6. import git,os
  7. localrep = "/home"
  8. git.rw()
  9. git.reset(localrep)
  10. os.system('chmod -R 777 /home')
  11. os.system('rsync -r --checksum /home/backup/ /root')
  12. os.system("ps | grep main.py | grep -v grep | awk '{print $1}' | xargs kill")
  13. git.ro()