aboutsummaryrefslogtreecommitdiff
path: root/h-client/hlibrary.py
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-04-16 22:48:18 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-04-16 22:48:18 +0000
commit1614aa5cb29b3abbe59b45760d4cedf3b2183fa8 (patch)
tree1af08cf8fb45530cabfe94949733adafea5eca0b /h-client/hlibrary.py
parent0e2f0ad8b748e10ba19315cfeeae6ac6654ffb75 (diff)
h-client:used ordered dictionaries for the list of allowed distros
Diffstat (limited to 'h-client/hlibrary.py')
-rw-r--r--h-client/hlibrary.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/h-client/hlibrary.py b/h-client/hlibrary.py
index c55fb4a..38e7f78 100644
--- a/h-client/hlibrary.py
+++ b/h-client/hlibrary.py
@@ -24,6 +24,7 @@ import pycurl
import urllib
import htmlentitydefs
from xml.dom import minidom
+from odict import *
@@ -343,24 +344,6 @@ 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 +367,26 @@ class Client:
def __init__(self,url = ''):
self.request = Mycurl(url)
+ #create the allowedDistros ordered dictionary
+ self.allowedDistros = OrderedDict([
+ ('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')]
+ )
+
+
#check if a distro code is allowed or not
def distroIsAllowed(self,distroCode):
allowedDistroCodes = self.allowedDistros.keys()