aboutsummaryrefslogtreecommitdiff
path: root/ratinox
diff options
context:
space:
mode:
Diffstat (limited to 'ratinox')
-rwxr-xr-xratinox16
1 files changed, 8 insertions, 8 deletions
diff --git a/ratinox b/ratinox
index 33243b4..6cdad09 100755
--- a/ratinox
+++ b/ratinox
@@ -12,30 +12,30 @@ class Ratinox(xvfbwrapper.Xvfb):
def __init__(self, **kwargs):
if kwargs.pop("screencap", True) and "fbdir" in kwargs:
- self.screencap_file = os.path.join(kwargs["fbdir"], xvfb_screen_name)
+ self.screencap_file = os.path.join(kwargs["fbdir"], self.xvfb_screen_name)
else:
self.screencap_file = None
- super(Ratinox, self).__init__(**kwargs)
+ xvfbwrapper.Xvfb.__init__(self, **kwargs)
def __enter__(self):
- result = super(Ratinox, self).__enter__()
+ result = xvfbwrapper.Xvfb.__enter__(self)
self.wm = subprocess.Popen(("ratpoison",))
time.sleep(0.5)
return result
def __exit__(self, exc_type, exc_val, exc_tb):
- self.rat("quit")
+ subprocess.check_call(("ratpoison", "-c", "quit"))
self.wm.wait()
self.wm = None
- super(Ratinox, self).__exit__(exc_type, exc_val, exc_tb)
+ xvfbwrapper.Xvfb.__exit__(self, exc_type, exc_val, exc_tb)
def click(self, *coordinates):
assert len(coordinates) in (0, 2)
if coordinates:
- subproccess.check_call(("ratpoison", "-c", "ratwarp {:d} {:d}".format(*coordinates)))
+ subprocess.check_call(("ratpoison", "-c", "ratwarp {:d} {:d}".format(*coordinates)))
if self.screencap_file:
shutil.copy(self.screencap_file, "{}.{}".format(self.screencap_file, time.time()))
- subproccess.check_call(("ratpoison", "-c", "ratclick"))
+ subprocess.check_call(("ratpoison", "-c", "ratclick"))
def snooze(how_long = 15):
time.sleep(how_long)
@@ -122,7 +122,7 @@ def main():
ap.add_argument("command", choices = tuple(sorted(dispatch)))
args = ap.parse_args()
- dispatch[args.command]
+ dispatch[args.command]()
if __name__ == "__main__":
main()