MCPcopy Create free account
hub / github.com/comaps/comaps / run

Method run

tools/python/routing/src/utils.py:179–194  ·  view source on GitHub ↗
(self, *, binary, binary_cache_suffix=None, args, env=None, output_file=None, log_error_code=True)

Source from the content-addressed store, hash-verified

177 self._run_system(cmd=f'cp {aim} {binary_path}')
178
179 def run(self, *, binary, binary_cache_suffix=None, args, env=None, output_file=None, log_error_code=True):
180 binary_path = self._get_cached_binary_name(binary=binary, binary_cache_suffix=binary_cache_suffix)
181 if not os.path.exists(binary_path):
182 raise Exception(f'Cannot find {binary_path}, did you call build()?')
183
184 args_string = ""
185 for arg, value in args.items():
186 if value:
187 args_string += f' --{arg}={value}'
188 else:
189 args_string += f' --{arg}'
190
191 cmd = binary_path + args_string
192 code, _ = self._run_system_unsafe(cmd=cmd, env=env, output_file=output_file)
193 if log_error_code:
194 LOG.info(f'Finish with exit code: {code}')
195
196 def get_or_create_unique_dir_path(self, *, prefix_path):
197 branch_hash_name = get_branch_hash_name(branch=self.branch, hash=self.hash)

Callers 9

gh_apiFunction · 0.45
git_logFunction · 0.45
check_gh_cliFunction · 0.45
google_translateFunction · 0.45
google_translate_oneFunction · 0.45
mainFunction · 0.45
run_routes_builder_toolFunction · 0.45
run_routing_quality_toolFunction · 0.45

Calls 2

_run_system_unsafeMethod · 0.95

Tested by

no test coverage detected