aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-04-14 00:33:49 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-04-14 00:33:49 +0000
commit0e2f0ad8b748e10ba19315cfeeae6ac6654ffb75 (patch)
tree0001c492fe49044595963d6586a6129fec70893f /h-client/hlibrary.py
parenta22dc9e110c57b8335412f29dbdd8f1a7770dd4e (diff)
h-client:implemented a feature to help the user to select the distro
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py43
1 files changed, 25 insertions, 18 deletions
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index c86c66c..c55fb4a 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -41,24 +41,6 @@ class Device(object):
#list of options for the howItWorks entry
_howItWorksOptions = ['yes','no']
- #_allowedDistros = {
- #'blag_90001' : 'BLAG 90001',
- #'blag_120000' : 'BLAG 120000',
- #'dragora_1_1' : 'Dragora 1.1',
- #'dragora_2_0' : 'Dragora 2.0 Ardi',
- #'dynebolic_2_5_2' : 'Dynebolic 2.5.2 DHORUBA',
- #'gnewsense_2_3' : 'gNewSense 2.3 Deltah',
- #'gnewsense_3_0' : 'gNewSense 3.0 Metad',
- #'musix_2_0' : 'Musix GNU+Linux 2.0 R0',
- #'trisquel_3_5' : 'Trisquel 3.5 Awen',
- #'trisquel_4_0' : 'Trisquel 4.0 Taranis',
- #'trisquel_4_5' : 'Trisquel 4.5 Slaine',
- #'ututo_xs_2009' : 'UTUTO XS 2009',
- #'ututo_xs_2010' : 'UTUTO XS 2010',
- #'venenux_0_8' : 'VENENUX 0.8',
- #'venenux_0_8_2' : 'VENENUX-EC 0.8.2'
- #}
-
#allowed years of commercialization
_years = [
'not-specified',
@@ -361,6 +343,24 @@ class Mycurl:
class Client:
+ allowedDistros = {
+ 'blag_90001' : 'BLAG 90001',
+ 'blag_120000' : 'BLAG 120000',
+ 'dragora_1_1' : 'Dragora 1.1',
+ 'dragora_2_0' : 'Dragora 2.0 Ardi',
+ 'dynebolic_2_5_2' : 'Dynebolic 2.5.2 DHORUBA',
+ 'gnewsense_2_3' : 'gNewSense 2.3 Deltah',
+ 'gnewsense_3_0' : 'gNewSense 3.0 Metad',
+ 'musix_2_0' : 'Musix GNU+Linux 2.0 R0',
+ 'trisquel_3_5' : 'Trisquel 3.5 Awen',
+ 'trisquel_4_0' : 'Trisquel 4.0 Taranis',
+ 'trisquel_4_5' : 'Trisquel 4.5 Slaine',
+ 'ututo_xs_2009' : 'UTUTO XS 2009',
+ 'ututo_xs_2010' : 'UTUTO XS 2010',
+ 'venenux_0_8' : 'VENENUX 0.8',
+ 'venenux_0_8_2' : 'VENENUX-EC 0.8.2'
+ }
+
devices = {}
_status = True
@@ -384,6 +384,13 @@ class Client:
def __init__(self,url = ''):
self.request = Mycurl(url)
+ #check if a distro code is allowed or not
+ def distroIsAllowed(self,distroCode):
+ allowedDistroCodes = self.allowedDistros.keys()
+ if distroCode in allowedDistroCodes:
+ return True
+ return False
+
def getNode(self):
return self.request.getDomain()