installer 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env python
  2. import subprocess, os, time, xvfbwrapper, itertools
  3. def run(*args, **kwargs):
  4. return subprocess.Popen(args, **kwargs)
  5. def xte(*cmds):
  6. subprocess.check_call(("xte",) + cmds)
  7. def xwininfo():
  8. print(subprocess.check_output(("xwininfo", "-root", "-tree")))
  9. def ratpoison(*args):
  10. cmd = ["ratpoison"]
  11. cmd.extend(itertools.chain.from_iterable(("-c", a) for a in args))
  12. return subprocess.check_output(cmd)
  13. def main():
  14. with xvfbwrapper.Xvfb(fbdir = "/framebuf"):
  15. print("DISPLAY={}".format(os.getenv("DISPLAY")))
  16. rat = run("ratpoison")
  17. time.sleep(1)
  18. if False:
  19. run("xsetroot", "-gray").wait()
  20. run("xsetroot", "-cursor_name", "left_ptr", "-fg", "yellow", "-bg", "yellow").wait()
  21. time.sleep(1)
  22. xwininfo()
  23. xsetup = run("./xsetup", cwd = "/xilinx-unpack/Xilinx_ISE_DS_Lin_14.7_1015_1")
  24. time.sleep(1)
  25. xwininfo()
  26. snooze = lambda: time.sleep(15)
  27. print("First screen")
  28. snooze()
  29. ratpoison("ratwarp 650 610", "ratclick")
  30. print("Second screen")
  31. snooze()
  32. ratpoison("ratwarp 250 420", "ratclick",
  33. "ratwarp 250 444", "ratclick",
  34. "ratwarp 650 610", "ratclick")
  35. print("Third screen")
  36. snooze()
  37. ratpoison("ratwarp 600 560", "ratclick",
  38. "ratwarp 650 610", "ratclick")
  39. print("Fourth screen")
  40. snooze()
  41. ratpoison("ratwarp 300 100", "ratclick",
  42. "ratwarp 650 610", "ratclick")
  43. for ith in ("Fifth", "Sixth", "Seventh"):
  44. print(ith + " screen")
  45. snooze()
  46. ratpoison("ratclick")
  47. print("Waiting a few minutes, ^C if you get bored")
  48. time.sleep(1800)
  49. # Need to do awful visgrep thing here to find the finish button.
  50. # When we do find it:
  51. #ratpoison("ratwarp 720 610", "ratclick", "quit")
  52. if __name__ == "__main__":
  53. main()