(
name_executable,
in_file,
out_file,
output=subprocess.DEVNULL,
error=subprocess.DEVNULL,
run_async=False,
**kwargs,
)
| 40 | |
| 41 | |
| 42 | def osmconvert( |
| 43 | name_executable, |
| 44 | in_file, |
| 45 | out_file, |
| 46 | output=subprocess.DEVNULL, |
| 47 | error=subprocess.DEVNULL, |
| 48 | run_async=False, |
| 49 | **kwargs, |
| 50 | ): |
| 51 | env = os.environ.copy() |
| 52 | env["PATH"] = f"{settings.OSM_TOOLS_PATH}:{env['PATH']}" |
| 53 | p = subprocess.Popen( |
| 54 | [ |
| 55 | name_executable, |
| 56 | in_file, |
| 57 | "--drop-author", |
| 58 | "--drop-version", |
| 59 | "--out-o5m", |
| 60 | f"-o={out_file}", |
| 61 | ], |
| 62 | env=env, |
| 63 | stdout=output, |
| 64 | stderr=error, |
| 65 | ) |
| 66 | if run_async: |
| 67 | return p |
| 68 | else: |
| 69 | wait_and_raise_if_fail(p) |
| 70 | |
| 71 | |
| 72 | def osmupdate( |
no test coverage detected