Ejemplo n.º 1
0
def matcher(input_list, query=None):
    if query is None:
        return expand_tree(input_list)
    else:
        meta = expand_tree(input_list, 'yaml')
        corpus = {}
        for page in meta:
            dmeta = yaml.load(open(page, 'r'))
            if query['key'] in dmeta and (
                    (dmeta[query['key']] is query['value']) or
                    (query['value'] in dmeta[query['key']])):
                pass
            else:
                corpus[page.rsplit('.')[0] + '.rst'] = dmeta

    return corpus.keys()
Ejemplo n.º 2
0
def matcher(input_list, query=None):
    if query is None:
        return expand_tree(input_list)
    else:
        meta = expand_tree(input_list, 'yaml')
        corpus = {}
        for page in meta:
            dmeta = yaml.load(open(page, 'r'))
            if query['key'] in dmeta and (
                (dmeta[query['key']] is query['value']) or
                (query['value'] in dmeta[query['key']])):
                pass
            else:
                corpus[page.rsplit('.')[0] + '.rst'] = dmeta

    return corpus.keys()
Ejemplo n.º 3
0
def directory_archive(directory, output_type='archive'):
    file_list = expand_tree(directory)

    if output_type == 'archive':
        return render_content(file_list, output_type='archive')
    elif output_type == 'include':
        return render_content(file_list, output_type='include')
    else:
        return None