comaps-map-distributor 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comaps-map-distributor
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: A small CLI tool to download and then serve map files for CoMaps.
5
5
  Keywords: comaps,openstreetmap,map server
6
6
  Author: Bastian Greshake Tzovaras
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "comaps-map-distributor"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "A small CLI tool to download and then serve map files for CoMaps."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -159,11 +159,12 @@ def download_maps(selected_maps, base_url, map_version, download_location):
159
159
  per_file_progress = download_progress.add_task(
160
160
  "[yellow]File: {}".format(map_name),
161
161
  total=int(r.headers.get("content-length", 0)))
162
- with open(local_filename, 'wb') as f:
162
+ with open(local_filename+".part", 'wb') as f:
163
163
  for chunk in r.iter_content(chunk_size=8192):
164
164
  f.write(chunk)
165
165
  download_progress.update(per_file_progress, advance=8192)
166
166
  download_progress.update(per_file_progress, visible=False)
167
+ os.rename(local_filename+".part", local_filename)
167
168
  download_progress.update(overall_progress, advance=1)
168
169
  print(":white_check_mark:[bold] Downloaded: [/bold][italic]{}[/italic] from {}".format(
169
170
  map_name,