aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-03-22 02:56:07 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-03-22 02:56:07 +0000
commit18ba19ee1061b8591b221aea09c8c58a8a2a8f63 (patch)
tree97d33f1253e69055757316e39fb81380b981d8c8 /h-client/hlibrary.py
parent5f03c5201377af10161e620a322ec24592a854ff (diff)
improved GUI: added entries
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index 975f2f9..4be6a1b 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -1,20 +1,20 @@
# -*- coding: utf-8 -*-
-# hlibrary, a python library to manage the database of an h-source node
+# h-client, a python library to manage the database of an h-source node
# Copyright (C) 2011 Antonio Gallo
#
#
-# hlibrary is free software: you can redistribute it and/or modify
+# h-client is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# hlibrary is distributed in the hope that it will be useful,
+# h-client is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with hlibrary. If not, see <http://www.gnu.org/licenses/>.
+# along with h-client. If not, see <http://www.gnu.org/licenses/>.
import os
import string
@@ -55,22 +55,24 @@ class Device(object):
#'venenux_0_8_2' : 'VENENUX-EC 0.8.2'
#}
+ _interfaces = []
+
_status = True
errors = []
def __init__(self):
self._post = {}
- self._type = None
- self._vendor = None
- self._model = None
- self._kernel = None
+ self._type = ''
+ self._vendor = ''
+ self._model = ''
+ self._kernel = ''
self._distributions = [self.userDistribution()]
self._interface = 'not-specified'
self._year = 'not-specified'
- self._vendorId = None
- self._productId = None
- self._howItWorks = None
+ self._vendorId = ''
+ self._productId = ''
+ self._howItWorks = ''
self._driver = ''
self._description = ''
@@ -135,6 +137,9 @@ class Device(object):
self._status = False
self.errors.append('tmp folder not writable')
+ def getInterfaces(self):
+ return self._interfaces
+
def getType(self):
return self._type
@@ -219,6 +224,7 @@ class Videocard(Device):
super(Videocard, self).__init__()
self._type = 'videocard'
self._howItWorks = 'does_not_work'
+ self._interfaces = ['not-specified','PCI','AGP','PCI-E','ISA','MCA','VLB']
def setPost(self):
super(Videocard, self).setPost()
@@ -230,6 +236,7 @@ class Wifi(Device):
super(Wifi, self).__init__()
self._type = 'wifi'
self._howItWorks = 'no'
+ self._interfaces = ['not-specified','USB','PCI','PCI-E','mini-PCI','mini-PCI-E','ExpressCard','PC-Card']
def setPost(self):
super(Wifi, self).setPost()
@@ -241,6 +248,7 @@ class Soundcard(Device):
super(Soundcard, self).__init__()
self._type = 'soundcard'
self._howItWorks = 'no'
+ self._interfaces = ['not-specified','PCI','ISA','USB','Firewire','Parallel','PCI-E','PCMCIA']
def setPost(self):
super(Soundcard, self).setPost()
@@ -422,7 +430,6 @@ class Client:
dev.setProductId(pr.group(2).replace("\t",""))
dev.setModel(pr.group(1).replace("\t",""))
- dev.setInterface('not-specified')
dev.setKernel(self.getKernel())
self.devices['p_' + dev.getVendorId() + ':' + dev.getProductId()] = [dev,cl.group(2),'insert','0']