Fix bug with osmosis subprocess call, cleanup program output

This commit is contained in:
Mike C 2016-01-12 18:19:18 -05:00
parent acfe93d4de
commit b6b11a9318

View file

@ -53,7 +53,7 @@ if __name__ == '__main__':
print(' ', end='') print(' ', end='')
print(line) print(line)
subprocess.run([wget_cmd, '-P', 'dl', line.strip()], stdout=FNULL, stderr=subprocess.STDOUT) subprocess.run([wget_cmd, '-P', 'dl', line.strip()], stdout=FNULL, stderr=subprocess.STDOUT)
print(' Sleeping 1m to prevent throttle/blocking') print(' Sleeping to prevent throttle/blocking')
time.sleep(300) # Seconds time.sleep(300) # Seconds
print('Decompressing maps (if necessary)') print('Decompressing maps (if necessary)')
@ -71,7 +71,7 @@ if __name__ == '__main__':
print(' Found map: ', end='') print(' Found map: ', end='')
print(os.path.join(dirpath, file)) print(os.path.join(dirpath, file))
files_to_process.append(os.path.join(dirpath, file)) files_to_process.append(os.path.join(dirpath, file))
osmosis_cmd = [os.path.join(base_path, 'bin', 'osmosis', 'bin', 'osmosis', '-Djava.io.tmpdir=' + os.path.join(base_path), 'tmp')] osmosis_cmd = [os.path.join(base_path, 'bin', 'osmosis', 'bin', 'osmosis'), '-Djava.io.tmpdir=' + os.path.join(base_path, 'tmp')]
for file in files_to_process: for file in files_to_process:
if file.endswith('osm'): if file.endswith('osm'):
osmosis_cmd.extend(['--rx', 'file=' + file]) osmosis_cmd.extend(['--rx', 'file=' + file])