MCPcopy Create free account
hub / github.com/ddnet/ddnet / check_file

Function check_file

scripts/check_dilate.py:8–23  ·  view source on GitHub ↗
(dilate_path, filename)

Source from the content-addressed store, hash-verified

6
7
8def check_file(dilate_path, filename):
9 executable_path = os.path.join(dilate_path, "dilate")
10 try:
11 with subprocess.Popen(
12 [executable_path, "--dry-run", filename],
13 stdout=subprocess.PIPE,
14 stderr=subprocess.PIPE,
15 ) as process:
16 process.communicate()
17 not_dilated = process.returncode != 0
18 if not_dilated:
19 print(f"Error: '{filename}' is not dilated.")
20 return not_dilated
21 except FileNotFoundError:
22 print(f"Error: Executable not found at '{executable_path}'.")
23 return 1
24
25
26def check_dir(dilate_path, directory):

Callers 1

check_dirFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected