# Path: lektor/environment.py
# PRIMARY_ALT = '_primary'


import sqlite3
from lektor.environment import PRIMARY_ALT

        rv.append(info)
        if len(rv) == limit:
            break

    if files_needed:
        cur.execute('''
            select path, alt, lang, type, title
              from source_info
             where path in (%s)
        ''' % ', '.join(['?'] * len(files_needed)), list(files_needed))
        mapping.update(_mapping_from_cursor(cur))

    for info in rv:
        info['parents'] = _build_parent_path(info['path'], mapping, alt, lang)

    return rv


def find_files(builder, query, alt=PRIMARY_ALT, lang=None, limit=50, types=None):
    if types is None:
        types = ['page']
    else:
        types = list(types)
    languages = ['en']
    if lang not in ('en', None):
        languages.append(lang)
    else:
        lang = 'en'
    alts = [PRIMARY_ALT]

# Path: lektor/environment.py
# PRIMARY_ALT = '_primary'


# Path: lektor/sourcesearch.py
import sqlite3
from lektor.environment import PRIMARY_ALT


        rv.append(info)
        if len(rv) == limit:
            break

    if files_needed:
        cur.execute('''
            select path, alt, lang, type, title
              from source_info
             where path in (%s)
        ''' % ', '.join(['?'] * len(files_needed)), list(files_needed))
        mapping.update(_mapping_from_cursor(cur))

    for info in rv:
        info['parents'] = _build_parent_path(info['path'], mapping, alt, lang)

    return rv


def find_files(builder, query, alt=PRIMARY_ALT, lang=None, limit=50, types=None):
    if types is None:
        types = ['page']
    else:
        types = list(types)
    languages = ['en']
    if lang not in ('en', None):
        languages.append(lang)
    else:
        lang = 'en'
    alts = [PRIMARY_ALT]

    if alt != PRIMARY_ALT: