aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index 393de7e..a9e93dd 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -29,6 +29,7 @@ from xml.dom import minidom
class Device(object):
+ #from codename to h-source distro code
_distrosTable = {
'deltah' : 'gnewsense_2_3',
'metad' : 'gnewsense_3_0',
@@ -37,6 +38,9 @@ class Device(object):
'slaine' : 'trisquel_4_5'
}
+ #list of options for the howItWorks entry
+ _howItWorksOptions = ['yes','no']
+
#_allowedDistros = {
#'blag_90001' : 'BLAG 90001',
#'blag_120000' : 'BLAG 120000',
@@ -55,6 +59,7 @@ class Device(object):
#'venenux_0_8_2' : 'VENENUX-EC 0.8.2'
#}
+ #list of interfaces
_interfaces = []
_status = True
@@ -92,7 +97,7 @@ class Device(object):
string = string.replace("&"+entity+";",unichr(code))
return string.encode('utf-8')
- #get the distro h-source allowed code from the distro codename
+ #get the h-source distro code from the codename
def getDistroCode(self,codenameString):
codenames = self._distrosTable.keys()
for codename in codenames:
@@ -100,6 +105,7 @@ class Device(object):
return self._distrosTable[codename]
return ''
+ #create the distribution entry
def createDistroEntry(self):
cleanDistros = []
for distro in self._distributions:
@@ -121,12 +127,13 @@ class Device(object):
self._distributions.append(distroName)
#add many distributions
- #distroList: comma separated list of distros
+ #distroList: comma separated list of distros (type: string)
def addDistributions(self,distroList):
distros = distroList.split(',')
for distro in distros:
self.addDistribution(distro)
+ #get the h-source distro code of the user
def userDistribution(self):
if not os.system('cat /etc/*-release | grep CODENAME > tmp/temp'):
f = open('tmp/temp','r')
@@ -137,6 +144,9 @@ class Device(object):
self._status = False
self.errors.append('tmp folder not writable')
+ def getHowItWorksOptions(self):
+ return self._howItWorksOptions
+
def getInterfaces(self):
return self._interfaces
@@ -225,6 +235,7 @@ class Videocard(Device):
self._type = 'videocard'
self._howItWorks = 'does_not_work'
self._interfaces = ['not-specified','PCI','AGP','PCI-E','ISA','MCA','VLB']
+ self._howItWorksOptions = ['works_with_3D','works_without_3D','does_not_work']
def setPost(self):
super(Videocard, self).setPost()