Last change
on this file since 17487 was
2488,
checked in by joachim, 17 years ago
|
set found to true
|
-
Property svn:keywords set to
Id
|
File size:
698 bytes
|
Rev | Line | |
---|
[1401] | 1 | ## Script (Python) "getLevelFromResultsList" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=list |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: getLevelFromResultsCosCode.py 2488 2007-10-31 10:45:45Z joachim $ |
---|
| 11 | lnr = 0 |
---|
[2487] | 12 | found = False |
---|
[1401] | 13 | for e in list: |
---|
[1677] | 14 | if e.CosCode == "N/A": |
---|
| 15 | |
---|
| 16 | # used for medical dummy results |
---|
| 17 | # return 2 |
---|
| 18 | |
---|
| 19 | # used for 'Temporary Withdrawal' dummy results |
---|
[1678] | 20 | return int(e.Level[0]) |
---|
[1401] | 21 | try: |
---|
| 22 | cc = int(e.CosCode[3]) |
---|
[2488] | 23 | found = True |
---|
[1401] | 24 | except: |
---|
| 25 | continue |
---|
| 26 | if lnr <= cc: |
---|
| 27 | lnr = cc |
---|
[2487] | 28 | if found: |
---|
| 29 | return lnr |
---|
| 30 | lnr = 0 |
---|
| 31 | for e in list: |
---|
| 32 | try: |
---|
| 33 | lnr = int(e.Level[0]) |
---|
| 34 | break |
---|
| 35 | except: |
---|
| 36 | continue |
---|
[1401] | 37 | return lnr |
---|
Note: See
TracBrowser for help on using the repository browser.