Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer subprocess run over call #625

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions scripts/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def round_png(pvd: str) -> None:

def _round(base: str, path: str):
path = os.path.join(base, path)
subprocess.call([cfg.CMD_ROUND, *cfg.CMD_ROUND_OPTS, path])
subprocess.run([cfg.CMD_ROUND, *cfg.CMD_ROUND_OPTS, path])

for root, _, files in os.walk(resource_dir(pvd)):
pngs = filter(lambda f: f.endswith(".png"), files)
Expand All @@ -178,8 +178,8 @@ def svg2png(pvd: str) -> None:

def _convert(base: str, path: str):
path = os.path.join(base, path)
subprocess.call([cfg.CMD_SVG2PNG, *cfg.CMD_SVG2PNG_OPTS, path])
subprocess.call(["rm", path])
subprocess.run([cfg.CMD_SVG2PNG, *cfg.CMD_SVG2PNG_OPTS, path])
subprocess.run(["rm", path])

for root, _, files in os.walk(resource_dir(pvd)):
svgs = filter(lambda f: f.endswith(".svg"), files)
Expand All @@ -192,8 +192,8 @@ def svg2png2(pvd: str) -> None:
def _convert(base: str, path: str):
path_src = os.path.join(base, path)
path_dest = path_src.replace(".svg", ".png")
subprocess.call([cfg.CMD_SVG2PNG_IM, *cfg.CMD_SVG2PNG_IM_OPTS, path_src, path_dest])
subprocess.call(["rm", path_src])
subprocess.run([cfg.CMD_SVG2PNG_IM, *cfg.CMD_SVG2PNG_IM_OPTS, path_src, path_dest])
subprocess.run(["rm", path_src])

for root, _, files in os.walk(resource_dir(pvd)):
svgs = filter(lambda f: f.endswith(".svg"), files)
Expand Down