Changeset 96 for trunk/python/Rappture/number.py
- Timestamp:
- Oct 10, 2005 3:29:58 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/Rappture/number.py
r55 r96 7 7 # ====================================================================== 8 8 import Rappture 9 import Rappture.Units 9 10 10 11 class number: … … 31 32 attrName = attr 32 33 s = Rappture.driver.get(self.path+'.'+attrName) 33 return (float(s),other) 34 # return (float(s),other) 35 # 36 # the following code doesnt work if the <units> tag does not exist 37 # becasue it sends an empty string to convert and it fails there 38 toUnit = Rappture.driver.get(self.path+'.units') 39 if (toUnit != None): 40 val = Rappture.Units.convert(s,to=toUnit,units="off") 41 else : 42 # you have to hope the user didn't put units onto the <default> 43 # value (which is unlikely in most cases, btw) 44 val = float(s) 45 return (val,other)
Note: See TracChangeset
for help on using the changeset viewer.