def _bootstrap()

in xar/xar_builder.py [0:0]


    def _bootstrap(self):
        """Set up the Python bootstrapping."""
        if self._interpreter is None:
            self._interpreter = py_util.environment_python_interpreter()
        if self._entry_point is None:
            raise self.InvalidEntryPointError("Entry point is not set")

        module, function = py_util.parse_entry_point(self._entry_point)
        fmt_args = {
            "python": self._interpreter,
            "module": module,
            "run_xar_main": bootstrap_py.RUN_XAR_MAIN,
        }
        if function is not None:
            fmt_args["function"] = function
        bootstrap_xar = bootstrap_py.BOOTSTRAP_XAR_TEMPLATE.format(**fmt_args)
        run_xar_main = bootstrap_py.run_xar_main(**fmt_args)

        self._staging.write(
            bootstrap_xar, bootstrap_py.BOOTSTRAP_XAR, mode="w", permissions=0o755
        )
        self._staging.write(
            run_xar_main, bootstrap_py.RUN_XAR_MAIN, mode="w", permissions=0o644
        )
        self.set_executable(bootstrap_py.BOOTSTRAP_XAR)