|
@@ -5,65 +5,62 @@ 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)
|
|
|
+ return subprocess.check_output(("ratpoison",) + tuple(itertools.chain.from_iterable(("-c", a) for a in args)))
|
|
|
+
|
|
|
+def snooze(how_long = 15):
|
|
|
+ time.sleep(how_long)
|
|
|
|
|
|
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()
|
|
|
+ print("Starting rodent-free window manager")
|
|
|
+ rat = run("ratpoison")
|
|
|
|
|
|
+ snooze()
|
|
|
+ print("Starting XiLinx installer")
|
|
|
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()
|
|
|
+ print("First screen")
|
|
|
ratpoison("ratwarp 650 610", "ratclick")
|
|
|
|
|
|
- print("Second screen")
|
|
|
snooze()
|
|
|
+ print("Second screen")
|
|
|
ratpoison("ratwarp 250 420", "ratclick",
|
|
|
"ratwarp 250 444", "ratclick",
|
|
|
"ratwarp 650 610", "ratclick")
|
|
|
|
|
|
- print("Third screen")
|
|
|
snooze()
|
|
|
+ print("Third screen")
|
|
|
ratpoison("ratwarp 600 560", "ratclick",
|
|
|
"ratwarp 650 610", "ratclick")
|
|
|
|
|
|
- print("Fourth screen")
|
|
|
snooze()
|
|
|
+ print("Fourth screen")
|
|
|
ratpoison("ratwarp 300 100", "ratclick",
|
|
|
"ratwarp 650 610", "ratclick")
|
|
|
-
|
|
|
+
|
|
|
for ith in ("Fifth", "Sixth", "Seventh"):
|
|
|
- print(ith + " screen")
|
|
|
snooze()
|
|
|
+ print(ith + " screen")
|
|
|
ratpoison("ratclick")
|
|
|
|
|
|
- print("Waiting a few minutes, ^C if you get bored")
|
|
|
- time.sleep(1800)
|
|
|
+ print("Waiting half an hour for XiLinx installer to run, ^C if you get bored")
|
|
|
+ snooze(1800)
|
|
|
+
|
|
|
+ # In theory we could use visgrep to check for the "finish" button.
|
|
|
+ # In practice ... this is such a kludge, what's one more, let's just
|
|
|
+ # try blindly clicking where the finish button should be and see
|
|
|
+ # if that results in a usable image.
|
|
|
+
|
|
|
+ print("Blindly clicking where finish button should be, then shutting down")
|
|
|
+ ratpoison("ratwarp 720 610", "ratclick",
|
|
|
+ "quit")
|
|
|
|
|
|
- # Need to do awful visgrep thing here to find the finish button.
|
|
|
- # When we do find it:
|
|
|
- #ratpoison("ratwarp 720 610", "ratclick", "quit")
|
|
|
+ print("xsetup exited with status {}".format(xsetup.wait()))
|
|
|
+ print("ratpoison exited with status {}".format(rat.wait()))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
main()
|