From 296ba160a075b2da20ba4ec5a1d50cdccd1bec38 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 14 Jul 2013 20:54:38 +0200 Subject: [PATCH] add a sispmctl_device --- onoff/tools.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 onoff/tools.py diff --git a/onoff/tools.py b/onoff/tools.py new file mode 100644 index 0000000..fd5e5f2 --- /dev/null +++ b/onoff/tools.py @@ -0,0 +1,11 @@ +from .command import OnoffCommand + +def sispmctl_device(sock): + """Create an OnoffCommand that controls the specified socket on a sispmctl + device. + + @type sock: int + @param sock: the socket number of the sispmctl controlled device + """ + return OnoffCommand(["sispmctl", "-o", "%d" % sock], + ["sispmctl", "-f", "%d" % sock]) -- 2.20.1