|
@@ -0,0 +1,69 @@
|
|
|
+#!/usr/bin/env python
|
|
|
+
|
|
|
+import subprocess, os, time, xvfbwrapper, itertools
|
|
|
+
|
|
|
+def run(*args, **kwargs):
|
|
|
+ return subprocess.Popen(args, **kwargs)
|
|
|
+
|
|
|
+def xte(*cmds):
|
|
|
+ subprocess.check_call(("xte",) + cmds)
|
|
|
+
|
|
|
+def xwininfo():
|
|
|
+ print(subprocess.check_output(("xwininfo", "-root", "-tree")))
|
|
|
+
|
|
|
+def ratpoison(*args):
|
|
|
+ cmd = ["ratpoison"]
|
|
|
+ cmd.extend(itertools.chain.from_iterable(("-c", a) for a in args))
|
|
|
+ return subprocess.check_output(cmd)
|
|
|
+
|
|
|
+def main():
|
|
|
+ with xvfbwrapper.Xvfb(fbdir = "/framebuf"):
|
|
|
+ print("DISPLAY={}".format(os.getenv("DISPLAY")))
|
|
|
+ rat = run("ratpoison")
|
|
|
+ time.sleep(1)
|
|
|
+
|
|
|
+ if False:
|
|
|
+ run("xsetroot", "-gray").wait()
|
|
|
+ run("xsetroot", "-cursor_name", "left_ptr", "-fg", "yellow", "-bg", "yellow").wait()
|
|
|
+ time.sleep(1)
|
|
|
+ xwininfo()
|
|
|
+
|
|
|
+ xsetup = run("./xsetup", cwd = "/xilinx-unpack/Xilinx_ISE_DS_Lin_14.7_1015_1")
|
|
|
+ time.sleep(1)
|
|
|
+ xwininfo()
|
|
|
+ snooze = lambda: time.sleep(15)
|
|
|
+
|
|
|
+ print("First screen")
|
|
|
+ snooze()
|
|
|
+ ratpoison("ratwarp 650 610", "ratclick")
|
|
|
+
|
|
|
+ print("Second screen")
|
|
|
+ snooze()
|
|
|
+ ratpoison("ratwarp 250 420", "ratclick",
|
|
|
+ "ratwarp 250 444", "ratclick",
|
|
|
+ "ratwarp 650 610", "ratclick")
|
|
|
+
|
|
|
+ print("Third screen")
|
|
|
+ snooze()
|
|
|
+ ratpoison("ratwarp 600 560", "ratclick",
|
|
|
+ "ratwarp 650 610", "ratclick")
|
|
|
+
|
|
|
+ print("Fourth screen")
|
|
|
+ snooze()
|
|
|
+ ratpoison("ratwarp 300 100", "ratclick",
|
|
|
+ "ratwarp 650 610", "ratclick")
|
|
|
+
|
|
|
+ for ith in ("Fifth", "Sixth", "Seventh"):
|
|
|
+ print(ith + " screen")
|
|
|
+ snooze()
|
|
|
+ ratpoison("ratclick")
|
|
|
+
|
|
|
+ print("Waiting a few minutes, ^C if you get bored")
|
|
|
+ time.sleep(1800)
|
|
|
+
|
|
|
+ # Need to do awful visgrep thing here to find the finish button.
|
|
|
+ # When we do find it:
|
|
|
+ #ratpoison("ratwarp 720 610", "ratclick", "quit")
|
|
|
+
|
|
|
+if __name__ == "__main__":
|
|
|
+ main()
|