Subversion Repositories SmartDukaan

Rev

Rev 73 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73 Rev 75
Line 4... Line 4...
4
print "expSlide=" + `expSlide`
4
print "expSlide=" + `expSlide`
5
 
5
 
6
struct = utils.contentModel2Struct(expSlide)
6
struct = utils.contentModel2Struct(expSlide)
7
print "struct=" + `struct`
7
print "struct=" + `struct`
8
 
8
 
9
score = mathmodel.getscore(struct)
-
 
10
9
newstruct = {}
-
 
10
 
-
 
11
# Copy features as is
-
 
12
if struct.has_key("features") :
-
 
13
    features = struct.get("features")
-
 
14
    newstruct['features'] = features
-
 
15
    
-
 
16
# Talktime and Standby time become 'childrenslides' and bullets go under 'features' > '2G'
-
 
17
if struct.has_key("childrenslides") :
-
 
18
    childrenslides = struct.get("childrenslides")
-
 
19
    newchildrenslides = {}
-
 
20
    
-
 
21
    if childrenslides.has_key("Capacity") :
-
 
22
        capacity = childrenslides.get("Capacity")
-
 
23
        newcapacity = {}
-
 
24
        
-
 
25
        if capacity.has_key("features") :
-
 
26
            features = capacity.get("features")
-
 
27
            
-
 
28
            if features.has_key("Talk time") :
-
 
29
                talktimebullets = features.get("Talk time")
-
 
30
                newtalktimefeatures = {}
-
 
31
                newtalktimefeatures['2G'] = talktimebullets
-
 
32
                
-
 
33
                newtalktime = {}
-
 
34
                newtalktime['features'] = newtalktimefeatures
-
 
35
                newcapacity['Talk time'] = newtalktime
-
 
36
                
-
 
37
            if features.has_key("Standby time") :
-
 
38
                standbytimebullet = features.get("Standby time")
-
 
39
                newstandbytimefeatures = {}
-
 
40
                newstandbytimefeatures['2G'] = standbytimebullet
-
 
41
                
-
 
42
                newstandbytime = {}
-
 
43
                newstandbytime['features'] = newstandbytimefeatures
-
 
44
                newcapacity['Standby time'] = newstandbytime
-
 
45
        
-
 
46
        a = {}
-
 
47
        a['childrenslides'] = newcapacity
-
 
48
        newchildrenslides['Capacity'] = a
-
 
49
        
-
 
50
    newstruct['childrenslides'] = newchildrenslides 
-
 
51
        
-
 
52
print "newstruct=" + `newstruct`
-
 
53
score = mathmodel.getscore(newstruct)
-
 
54
11
55