matthew.hart@linaro.org | 5e4fce9 | 2013-08-22 11:29:21 +0100 | [diff] [blame] | 1 | #! /usr/bin/python |
| 2 | |
| 3 | # Copyright 2013 Linaro Limited |
| 4 | # Author Matt Hart <matthew.hart@linaro.org> |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 2 of the License, or |
| 9 | # (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 19 | # MA 02110-1301, USA. |
| 20 | |
Matt Hart | 1306d82 | 2013-08-09 12:08:22 +0100 | [diff] [blame] | 21 | import pexpect |
Matt Hart | 1306d82 | 2013-08-09 12:08:22 +0100 | [diff] [blame] | 22 | import os |
Matt Hart | 63ed911 | 2013-08-20 13:31:50 +0100 | [diff] [blame] | 23 | import logging |
Matt Hart | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame] | 24 | import pkgutil |
matthew.hart@linaro.org | 753a90c | 2014-01-20 09:45:25 +0000 | [diff] [blame] | 25 | import sys |
Matt Hart | 96ca866 | 2013-08-21 13:37:35 +0100 | [diff] [blame] | 26 | |
Matt Hart | 1306d82 | 2013-08-09 12:08:22 +0100 | [diff] [blame] | 27 | |
| 28 | class PDUEngine(): |
| 29 | connection = None |
Matt Hart | 1306d82 | 2013-08-09 12:08:22 +0100 | [diff] [blame] | 30 | prompt = 0 |
| 31 | driver = None |
Matt Hart | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame] | 32 | firmware_dict = {} |
Matt Hart | 1306d82 | 2013-08-09 12:08:22 +0100 | [diff] [blame] | 33 | |
Matt Hart | 2af7114 | 2014-07-22 10:40:41 +0100 | [diff] [blame] | 34 | def __init__(self, pdu_hostname): |
| 35 | pass |
Matt Hart | 1306d82 | 2013-08-09 12:08:22 +0100 | [diff] [blame] | 36 | |
| 37 | if __name__ == "__main__": |
matthew.hart@linaro.org | 753a90c | 2014-01-20 09:45:25 +0000 | [diff] [blame] | 38 | logging.basicConfig(level=logging.DEBUG) |
| 39 | logging.getLogger().setLevel(logging.DEBUG) |
Matt Hart | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame] | 40 | pe = PDUEngine("pdu01") |
| 41 | pe.driver.port_off(1) |
| 42 | pe.driver.port_on(1) |
| 43 | pe.close() |
| 44 | pe = PDUEngine("pdu03") |
| 45 | pe.driver.port_off(3) |
| 46 | pe.driver.port_on(3) |
| 47 | pe.close() |
| 48 | |
| 49 | #pe = PDUEngine("pdu16") |
| 50 | #pe.close() |