Revision 1464
Added by Aaron Marcuse-Kubitza almost 13 years ago
xml_func.py | ||
---|---|---|
151 | 151 |
def _units(items): |
152 | 152 |
items = dict(conv_items(str, items)) |
153 | 153 |
try: value = items['value'] |
154 |
except KeyError, e: raise SyntaxException(e)
|
|
154 |
except KeyError: return None # input is empty
|
|
155 | 155 |
default_units = items.get('units', None) |
156 | 156 |
# DB unit conversion isn't ready yet, so just return number |
157 | 157 |
try: return format.cleanup_units(value, default_units).split(' ')[0] |
Also available in: Unified diff
xml_func.py: _units: Allow value to be NULL