File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,18 @@ def get_filename_from_url(url: str) -> str:
17
17
18
18
def is_download_needed (target_file_path : str ) -> bool :
19
19
if not os .path .exists (meshes_path ):
20
+ print (f"Creating path { meshes_path } " )
20
21
os .mkdir (meshes_path )
21
22
return True
23
+
22
24
if not os .path .exists (os .path .join (meshes_path , "trees" )):
23
25
if not os .path .isfile (os .path .join (meshes_path , "pybullet-tree-sim-meshes.zip" )): # TODO: pass name into func
24
26
return True
25
27
else :
28
+ print (f"File { os .path .join (meshes_path , "pybullet-tree-sim-meshes.zip" )} already exists" )
26
29
return False
27
30
else :
31
+ print (f"Path { os .path .join (meshes_path , 'trees' )} already exists." )
28
32
return False
29
33
30
34
@@ -58,8 +62,13 @@ def download_file(url: str, target_file_path: str) -> bool:
58
62
59
63
60
64
def unzip (zip_file : str ):
65
+ print (f"Extracting file { zip_file } " )
61
66
with zipfile .ZipFile (zip_file , "r" ) as zipper :
62
67
zipper .extractall (os .path .dirname (zip_file ))
68
+ print (f"Files extracted" )
69
+
70
+ if not os .path .exists (meshes_path ):
71
+ print (f"Cannot find path { meshes_path } , error with process. Try running the file directly." )
63
72
return
64
73
65
74
You can’t perform that action at this time.
0 commit comments