Skip to content

Commit

Permalink
Prefer subprocess run over call as suggested in mingrammer#625
Browse files Browse the repository at this point in the history
  • Loading branch information
jurikolo committed Sep 21, 2022
1 parent 46b2e9b commit 8f34777
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,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 @@ -187,8 +187,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 @@ -201,8 +201,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

0 comments on commit 8f34777

Please sign in to comment.