Exemplo n.º 1
0
def stream_resolve_include_path(interp, filename):
    """ Resolve filename against the include path"""

    for path in interp.include_path:
        fullpath = rpath.join(path, [filename])
        if rpath.exists(fullpath):
            return interp.space.wrap(rpath.realpath(fullpath))

    return interp.space.w_False
Exemplo n.º 2
0
def _spl_autoload(interp, class_name, file_extensions_list):
    class_id = class_name.lower()

    for extension in file_extensions_list:
        for path in interp.include_path:
            fname = rpath.join(path, ["%s%s" % (class_id, extension)])
            if rpath.exists(fname):
                bc = interp.compile_file(fname)
                interp.run_include(bc, interp.global_frame)