def init_load_path(self_path): if not path.isfile(self_path): self_path = find_in_path(self_path) assert self_path is not None if path.islink(self_path): self_path = os.readlink(self_path) self_path = dirname(rpath.rabspath(self_path)) # runtime is not loaded yet, so we have to do it manually if build_config.USE_GLOBAL_LOADPATH: LOAD_PATHS.set_root(Atom(EMPTY_VECTOR.conj(rt.wrap(build_config.STDLIB_LOADPATH)))) load_path.set_root(rt.wrap(build_config.STDLIB_LOADPATH)) else: LOAD_PATHS.set_root(Atom(EMPTY_VECTOR.conj(rt.wrap(self_path)))) # just for run_load_stdlib (global variables can't be assigned to) load_path.set_root(rt.wrap(self_path)) add_env_to_load_path()
def init_load_path(self_path): if not path.isfile(self_path): self_path = find_in_path(self_path) assert self_path is not None if path.islink(self_path): self_path = os.readlink(self_path) self_path = dirname(rpath.rabspath(self_path)) # runtime is not loaded yet, so we have to do it manually LOAD_PATHS.set_root(Atom(EMPTY_VECTOR.conj(rt.wrap(self_path)))) # just for run_load_stdlib (global variables can't be assigned to) load_path.set_root(rt.wrap(self_path))
from target import entry_point, load_stdlib, init_load_path, LOAD_PATHS, load_path, BatchModeFn from pixie.vm.atom import Atom from pixie.vm.persistent_vector import EMPTY as EMPTY_VECTOR from pixie.vm.symbol import symbol from pixie.vm.code import intern_var import pixie.vm.rt as rt rt.init() load_path.set_root(rt.wrap(u"./")) LOAD_PATHS.set_root(Atom(EMPTY_VECTOR.conj(rt.wrap(u"./")))) load_stdlib() BatchModeFn(["pixie/preload.pxi"]).invoke([]) def target(*args): import pixie.vm.rt as rt driver = args[0] driver.exe_name = "pixie-vm" rt.__config__ = args[0].config return entry_point, None import rpython.config.translationoption print rpython.config.translationoption.get_combined_translation_config() if __name__ == "__main__":
from target import entry_point, load_stdlib, init_load_path, LOAD_PATHS, load_path, BatchModeFn from pixie.vm.atom import Atom from pixie.vm.persistent_vector import EMPTY as EMPTY_VECTOR from pixie.vm.symbol import symbol from pixie.vm.code import intern_var import pixie.vm.rt as rt rt.init() load_path.set_root(rt.wrap(u"./")) LOAD_PATHS.set_root(Atom(EMPTY_VECTOR.conj(rt.wrap(u"./")))) load_stdlib() BatchModeFn(["pixie/preload.pxi"]).invoke([]) def target(*args): import pixie.vm.rt as rt driver = args[0] driver.exe_name = "pixie-vm" rt.__config__ = args[0].config return entry_point, None import rpython.config.translationoption print rpython.config.translationoption.get_combined_translation_config() if __name__ == "__main__": entry_point(sys.argv)