Lines Matching refs:os
18 import os
23 os.path.dirname(os.path.dirname(os.path.dirname(
24 os.path.abspath(__file__)))))
29 if not os.path.exists(src_image_path):
33 for root, dirs, files in os.walk(src_image_path):
35 src_dir = os.path.join(root, dir_name)
36 dir_relpath = os.path.relpath(src_dir, src_image_path)
37 dest_dir_path = os.path.join(dest_image_path, dir_relpath)
38 if not os.path.exists(dest_dir_path):
39 os.makedirs(dest_dir_path, exist_ok=True)
42 src_file_path = os.path.join(root, file_name)
43 file_relpath = os.path.relpath(src_file_path, src_image_path)
44 dest_file_path = os.path.join(dest_image_path, file_relpath)
45 if not os.path.exists(dest_file_path):
46 if not os.path.exists(os.path.dirname(dest_file_path)):
47 os.makedirs(os.path.dirname(dest_file_path), exist_ok=True)
56 if os.path.exists(f):
60 tar.add(f, arcname=os.path.basename(f))