MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / invoke_commandlet

Function invoke_commandlet

Util/BuildTools/Import.py:41–59  ·  view source on GitHub ↗

Generic function for running a commandlet with its arguments.

(name, arguments)

Source from the content-addressed store, hash-verified

39
40
41def invoke_commandlet(name, arguments):
42 """Generic function for running a commandlet with its arguments."""
43 ue4_path = os.environ["UE4_ROOT"]
44 uproject_path = os.path.join(CARLA_ROOT_PATH, "Unreal", "CarlaUE4", "CarlaUE4.uproject")
45 run = "-run=%s" % (name)
46
47 if os.name == "nt":
48 sys_name = "Win64"
49 editor_path = "%s/Engine/Binaries/%s/UE4Editor" % (ue4_path, sys_name)
50 command = [editor_path, uproject_path, run]
51 command.extend(arguments)
52 print("Commandlet:", command)
53 subprocess.check_call(command, shell=True)
54 elif os.name == "posix":
55 sys_name = "Linux"
56 editor_path = "%s/Engine/Binaries/%s/UE4Editor" % (ue4_path, sys_name)
57 full_command = "%s %s %s %s" % (editor_path, uproject_path, run, " ".join(arguments))
58 print("Commandlet:", full_command)
59 subprocess.call([full_command], shell=True)
60
61
62

Callers 3

import_assetsFunction · 0.85
move_assets_commandletFunction · 0.85

Calls 1

callMethod · 0.80

Tested by

no test coverage detected