Project

General

Profile

« Previous | Next » 

Revision 1225

xml_func.py: Added _units

View differences:

lib/xml_func.py
112 112
    return value
113 113
funcs['_replace'] = _replace
114 114

  
115
def _units(items):
116
    items = dict(conv_items(str, items))
117
    try:
118
        units = items['units']
119
        value = items['value']
120
    except KeyError, e: raise SyntaxException(e)
121
    return value#+' '+units # don't add yet because unit conversion isn't ready
122
funcs['_units'] = _units
123

  
115 124
def _range(items):
116 125
    items = dict(conv_items(float, items))
117 126
    from_ = items.get('from', None)

Also available in: Unified diff