diff options
author | Rob Austein <sra@hactrn.net> | 2019-02-14 07:12:12 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-02-14 07:12:12 +0000 |
commit | 6f702a880c0c8300385945afead0a8e8d8236adc (patch) | |
tree | 591f5458ccb21c85cbb569e53c6970bfb6c8d910 /ratinox | |
parent | d3a03cf27dab20ee49e2d245f6ca43c98c268cf8 (diff) |
Debug.
Diffstat (limited to 'ratinox')
-rwxr-xr-x | ratinox | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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() |