コード例 #1
0
ファイル: bytecode_cache.py プロジェクト: sk-/hippyvm
 def _find_file(self, interp, fname):
     if not exists(fname):
         for path in interp.include_path:
             if exists(join(path, [fname])):
                 return join(path, [fname])
     # this is stupid, but...
     actual_code_dir = dirname(interp.global_frame.bytecode.filename)
     if exists(join(actual_code_dir, [fname])):
         return join(actual_code_dir, [fname])
     return abspath(fname)
コード例 #2
0
ファイル: funcs.py プロジェクト: AirBayCreative/hippyvm
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
コード例 #3
0
ファイル: funcs.py プロジェクト: rlamy/hippyvm
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)
コード例 #4
0
ファイル: funcs.py プロジェクト: rlamy/hippyvm
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