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 | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame^] | 21 | import logging |
Neil Williams | 16579dc | 2014-02-13 11:20:04 +0000 | [diff] [blame] | 22 | |
Matt Hart | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame^] | 23 | |
| 24 | class NoDriverException(Exception): |
| 25 | pass |
| 26 | |
| 27 | |
| 28 | class PDUDriver(object): |
matthew.hart@linaro.org | 5e4fce9 | 2013-08-22 11:29:21 +0100 | [diff] [blame] | 29 | connection = None |
Matt Hart | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame^] | 30 | firmware_dict = {} |
matthew.hart@linaro.org | 5e4fce9 | 2013-08-22 11:29:21 +0100 | [diff] [blame] | 31 | |
| 32 | def __init__(self, connection): |
| 33 | self.connection = connection |
Matt Hart | 76fb254 | 2014-06-01 14:24:56 +0100 | [diff] [blame^] | 34 | |
| 35 | # return the driver that provides the firmware version |
| 36 | def _port_interaction(self, command, port_number): |
| 37 | pass |
| 38 | |
| 39 | def _pdu_logout(self): |
| 40 | pass |
| 41 | |
| 42 | def port_on(self, port_number): |
| 43 | self._port_interaction("on", port_number) |
| 44 | |
| 45 | def port_off(self, port_number): |
| 46 | self._port_interaction("off", port_number) |