move pcucontrol package into pcucontrol module.
[monitor.git] / pcucontrol / models / X10Toggle.py
diff --git a/pcucontrol/models/X10Toggle.py b/pcucontrol/models/X10Toggle.py
deleted file mode 100644 (file)
index 20d7cef..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-
-from pcucontrol.reboot import *
-### rebooting x10toggle based systems addressed by port
-# Marc E. Fiuczynski - May 31 2005
-# tested on 4-ports models known as PSE505-FR
-# uses ssh and password to login to an account
-# that will cause the system to be powercycled.
-
-TELNET_TIMEOUT = 120
-def telnet_answer(telnet, expected, buffer):
-       global verbose
-
-       output = telnet.read_until(expected, TELNET_TIMEOUT)
-       #if verbose:
-       #       logger.debug(output)
-       if output.find(expected) == -1:
-               raise ExceptionNotFound, "'%s' not found" % expected
-       else:
-               telnet.write(buffer + "\r\n")
-
-def x10toggle_reboot(ip, username, password, port, dryrun):
-       global verbose
-
-       ssh = None
-       try:
-               ssh = pyssh.Ssh(username, ip)
-               ssh.open()
-
-               # Login
-               telnet_answer(ssh, "password:", password)
-
-               if not dryrun:
-                       # Reboot
-                       telnet_answer(ssh, "x10toggle>", "A%d" % port)
-
-               # Close
-               output = ssh.close()
-               if verbose:
-                       logger.debug(output)
-               return 0
-
-       except Exception, err:
-               if verbose:
-                       logger.debug(err)
-               if ssh:
-                       output = ssh.close()
-                       if verbose:
-                               logger.debug(output)
-               return errno.ETIMEDOUT