INNER CODE UNIT · Python

path_to_module

metatypedev/metatype · src/pyrt_wit_wire/main.py:144

    def path_to_module(path: str):
        return os.path.splitext((os.path.normpath(path)))[0].replace("/", ".")

    def debug(self):
        print("= Loaded modules summary == == == ==")
        print(f" modules: {self._mod_names}")
        print(f" packages: {self._pkg_names}")
        print("== == == == == == == == == == == ==")

    def __init__(self, modules: Dict[str, str]):
        self._mods_raw = modules
        self._pkgs = set()
        for path in self._mods_raw:
            dirname = os.path.dirname(path)
            while dirname != "/" and dirname != "" and dirname != ".":
                if dirname not in self._mods_raw:
                    self._pkgs.add(dirname)
                dirname = os.path.dirname(dirname)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…