File tree Expand file tree Collapse file tree
functions-python/pmtiles_builder/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717import logging
1818import os
1919import subprocess
20- import sys
2120from pathlib import Path
2221from typing import TypedDict , List , Dict
2322
@@ -42,7 +41,7 @@ class ShapeTrips(TypedDict):
4241 trip_ids : List [str ]
4342
4443
45- def print_df (mountpoint : str ):
44+ def get_volume_size (mountpoint : str ):
4645 """
4746 Returns the total size of the specified filesystem mount point in a human-readable format.
4847
@@ -61,7 +60,7 @@ def print_df(mountpoint: str):
6160 """
6261 mp = Path (mountpoint )
6362 if not mp .exists ():
64- print ( f "Mountpoint not found: { mp } " , file = sys . stderr )
63+ logging . warning ( "Mountpoint not found: %s " , mountpoint )
6564 return "N/A"
6665 cmd = [
6766 "bash" ,
@@ -105,7 +104,7 @@ def __init__(
105104 self .trips_no_shapes_per_route : Dict [str , List [str ]] = {}
106105
107106 self .logger .info ("Using work directory: %s" , self .workdir )
108- self .logger .info ("Size of workdir: %s" , print_df (self .workdir ))
107+ self .logger .info ("Size of workdir: %s" , get_volume_size (self .workdir ))
109108
110109 def debug_log_size (self , label : str , obj : object ) -> None :
111110 """Log the deep size of an object in bytes when DEBUG is enabled."""
You can’t perform that action at this time.
0 commit comments