MCPcopy
hub / github.com/pex-tool/pex / execute_script

Method execute_script

pex/pex.py:768–790  ·  view source on GitHub ↗
(self, script_name)

Source from the content-addressed store, hash-verified

766 safe_execv(cmdline)
767
768 def execute_script(self, script_name):
769 # type: (str) -> Any
770 dists = list(self.activate())
771
772 dist_entry_point = get_entry_point_from_console_script(script_name, dists)
773 if dist_entry_point:
774 TRACER.log(
775 "Found {console_script}.".format(
776 console_script=dist_entry_point.render_description()
777 )
778 )
779 return self.execute_entry(dist_entry_point.entry_point)
780
781 dist_script = get_script_from_distributions(script_name, dists)
782 if not dist_script:
783 return "Could not find script {!r} in pex!".format(script_name)
784
785 TRACER.log("Found script {!r} in {!r}.".format(script_name, dist_script.dist))
786 ast = dist_script.python_script()
787 if ast:
788 return self.execute_ast(dist_script.path, ast, argv0=script_name)
789 else:
790 return self.execute_external(dist_script.path)
791
792 @staticmethod
793 def execute_external(binary):

Callers 1

_executeMethod · 0.95

Calls 9

activateMethod · 0.95
execute_entryMethod · 0.95
execute_astMethod · 0.95
execute_externalMethod · 0.95
logMethod · 0.80
python_scriptMethod · 0.80
render_descriptionMethod · 0.45

Tested by

no test coverage detected