Subversion Repositories SmartDukaan

Rev

Rev 66 | Rev 346 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
66 naveen 1
if vars().has_key('expSlide'):
2
    print "expSlide=" + `expSlide`
3
 
4
# Pick 2G and 3G Feature objects
5
expandedFeatures = expSlide.getExpandedFeatures()
6
for expandedFeature in expandedFeatures:
7
    label = expandedFeature.getFeatureDefinition().getLabel()
8
    if label == "2G":
9
        twoGFeature = expandedFeature
10
    elif label == "3G":
11
        threeGFeature = expandedFeature 
12
 
13
twoGBullets = twoGFeature.getExpandedBullets()
14
 
15
# Is a single-value field
16
twoGBullet = twoGBullets[0]
17
v2G = twoGBullet.getValue()
18
print "v2G=" + `v2G`
19
v2Gparts = v2G.split()
20
 
21
# Take only hours
22
v2Ghours = int(v2Gparts[0])
23
print "v2Ghours=" + `v2Ghours`
24
 
25
threeGBullets = threeGFeature.getExpandedBullets()
26
 
27
# Is a single-value field
28
threeGBullet = threeGBullets[0]
29
v3G = threeGBullet.getValue()
30
print "v3G=" + `v3G`
31
v3Gparts = v3G.split()
32
 
33
# Take only hours
34
v3Ghours = int(v3Gparts[0])
35
print "v3Ghours=" + `v3Ghours`
36
 
37
# Rough values
38
# 2G High > 10, Medium > 5 else Low
39
# 3G High > 5, Medium > 3 else Low
40
 
41
# Overall: Highest of both e.g. if 2G:Low and 3G:Medium, Overall:Medium
42
 
43
# 1 - Low
44
# 2 - Medium
45
# 3 - High
46
 
47
# 2G logic
48
if v2Ghours >= 10:
49
    r2G = 3
50
elif v2Ghours >= 5:
51
    r2G = 2
52
else:
53
    r2G = 1
54
 
55
# 3G logic
56
if v3Ghours >= 5:
57
    r3G = 3
58
elif v3Ghours >= 3:
59
    r3G = 2
60
else:
61
    r3G = 1
62
 
63
print "r2G=" + `r2G`
64
print "r3G=" + `r3G`
65
 
66
# Overall score
67
if r2G < r3G:
68
    overall = r2G
69
else:
70
    overall = r3G
71
 
72
if overall == 1:
73
    strRate = "Low"
74
elif overall == 2:
75
    strRate = "Medium"
76
else:
77
    strRate = "High"
64 naveen 78
 
66 naveen 79
values = []
80
values.append(strRate)