Exemple #1
0
def get_records(module_directive, folder):
    """
    Return list of :class: `Struct` objects from module_directive.
    """
    records = []
    for r in module_directive.childs:
        if r.directive == 'struct':
            s = Struct(r.value, doc=get_directive_option(r, 'doc'))
            for param in get_params(r):
                s.add_param(param)
            records.append(s)
    return records
Exemple #2
0
def get_module_functions(module_directive):
    """
    Get list of :class: `Func` objects, from module_directive.
    """
    functions = []
    for f in module_directive.childs:
        if f.directive == 'func':
            fun = Func(f.value, doc=get_directive_option(f, 'doc'), \
                           store_optional_params_in_list=True)
            for fp in get_params(f):
                fun.add_param(fp)
            fun.returns = get_return_param(f)
            functions.append(fun)
    return functions