Project

General

Profile

« Previous | Next » 

Revision 4334

xml_func.py: Added helper functions variadic_args() and map_names()

View differences:

xml_func.py
32 32

  
33 33
##### Helper functions
34 34

  
35
def map_names(func, params):
36
    return [(func(name), value) for name, value in params]
37

  
38
def variadic_args(node):
39
    args = map_names(float, xml_dom.NodeEntryIter(node))
40
    args.sort()
41
    return [value for name, value in args]
42

  
35 43
def map_items(func, items):
36 44
    return [(name, func(value)) for name, value in items]
37 45

  

Also available in: Unified diff