Project

General

Profile

« Previous | Next » 

Revision 1320

xpath.py: Added get_1()

View differences:

lib/xpath.py
298 298
    
299 299
    return next
300 300

  
301
def get_1(*args, **kw_args):
302
    '''Runs get() and returns the first result'''
303
    return util.list_get(get(*args, **kw_args), 0)
304

  
301 305
def put_obj(root, xpath, id_, has_types, value=None):
302 306
    if util.is_str(xpath): xpath = parse(xpath)
303 307
    

Also available in: Unified diff