Project

General

Profile

« Previous | Next » 

Revision 2014

xml_func.py: _label: return None on empty input

View differences:

lib/xml_func.py
133 133
def _label(items):
134 134
    items = dict(conv_items(strings.ustr, items))
135 135
        # get *once* from iter, check types
136
    try:
137
        label = items['label']
138
        value = items['value']
136
    value = items.get('value', None)
137
    if value == None: return None # input is empty
138
    try: label = items['label']
139 139
    except KeyError, e: raise SyntaxError(e)
140 140
    return label+': '+value
141 141
funcs['_label'] = _label

Also available in: Unified diff