Loading py/cso_dataspace.py +7 −4 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ # 2025-02, Arjo Segers # Support user defined directory creation mode. # # 2025-02, Arjo Segers # Use 'shutil.move' instead of 'os.rename' for move over filesystem. # ######################################################################## Loading Loading @@ -840,9 +843,9 @@ class CSO_DataSpace_Downloader(object): # info .. logging.info(f"{indent}store ...") # create target dir if necessary: cso_file.CheckDir(output_file) cso_file.CheckDir(output_file, dmode=dmode) # move to destination: os.rename(member, output_file) shutil.move(member, output_file) # remove directory tree: shutil.rmtree(os.path.dirname(member)) # only one file in package; leave loop over members Loading @@ -866,9 +869,9 @@ class CSO_DataSpace_Downloader(object): logging.info(f"{indent}product is no zipfile, rename to output file ...") # this is probably the target file already; # create target dir if necessary: cso_file.CheckDir(output_file) cso_file.CheckDir(output_file, dmode=dmode) # rename to destination: os.rename(product_file, output_file) shutil.move(product_file, output_file) else: # quit with error: raise Loading py/cso_earthaccess.py +5 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ # 2025-02, Arjo Segers # Initial version based on script by Lewis Blake. # # 2025-02, Arjo Segers # Use 'shutil.move' instead of 'os.rename' for move over filesystem. # ######################################################################## ### Loading Loading @@ -483,6 +486,7 @@ class CSO_EarthAccess_Download(utopya.UtopyaRc): # modules: import os import shutil import datetime import earthaccess Loading Loading @@ -657,7 +661,7 @@ class CSO_EarthAccess_Download(utopya.UtopyaRc): # create directory if needed: cso_file.CheckDir(arch_file, dmode=dmode) # move: os.rename(fname, arch_file) shutil.move(fname, arch_file) # endif # endfor # filenames Loading py/cso_pal.py +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ # Retry download if failed, with increasing waiting time between attempts. # Trap errors on write permissions. # # 2025-02, Arjo Segers # Use 'shutil.move' instead of 'os.rename' for move over filesystem. # ######################################################################## ### Loading Loading @@ -389,6 +392,7 @@ class CSO_PAL_Downloader(object): # modules: import sys import os import shutil import time import requests Loading Loading @@ -425,7 +429,7 @@ class CSO_PAL_Downloader(object): # create target dir if necessary: cso_file.CheckDir(output_file, dmode=dmode) # move to destination: os.rename(product_file, output_file) shutil.move(product_file, output_file) # all ok, leave retry loop: break Loading Loading
py/cso_dataspace.py +7 −4 Original line number Diff line number Diff line Loading @@ -37,6 +37,9 @@ # 2025-02, Arjo Segers # Support user defined directory creation mode. # # 2025-02, Arjo Segers # Use 'shutil.move' instead of 'os.rename' for move over filesystem. # ######################################################################## Loading Loading @@ -840,9 +843,9 @@ class CSO_DataSpace_Downloader(object): # info .. logging.info(f"{indent}store ...") # create target dir if necessary: cso_file.CheckDir(output_file) cso_file.CheckDir(output_file, dmode=dmode) # move to destination: os.rename(member, output_file) shutil.move(member, output_file) # remove directory tree: shutil.rmtree(os.path.dirname(member)) # only one file in package; leave loop over members Loading @@ -866,9 +869,9 @@ class CSO_DataSpace_Downloader(object): logging.info(f"{indent}product is no zipfile, rename to output file ...") # this is probably the target file already; # create target dir if necessary: cso_file.CheckDir(output_file) cso_file.CheckDir(output_file, dmode=dmode) # rename to destination: os.rename(product_file, output_file) shutil.move(product_file, output_file) else: # quit with error: raise Loading
py/cso_earthaccess.py +5 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ # 2025-02, Arjo Segers # Initial version based on script by Lewis Blake. # # 2025-02, Arjo Segers # Use 'shutil.move' instead of 'os.rename' for move over filesystem. # ######################################################################## ### Loading Loading @@ -483,6 +486,7 @@ class CSO_EarthAccess_Download(utopya.UtopyaRc): # modules: import os import shutil import datetime import earthaccess Loading Loading @@ -657,7 +661,7 @@ class CSO_EarthAccess_Download(utopya.UtopyaRc): # create directory if needed: cso_file.CheckDir(arch_file, dmode=dmode) # move: os.rename(fname, arch_file) shutil.move(fname, arch_file) # endif # endfor # filenames Loading
py/cso_pal.py +5 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ # Retry download if failed, with increasing waiting time between attempts. # Trap errors on write permissions. # # 2025-02, Arjo Segers # Use 'shutil.move' instead of 'os.rename' for move over filesystem. # ######################################################################## ### Loading Loading @@ -389,6 +392,7 @@ class CSO_PAL_Downloader(object): # modules: import sys import os import shutil import time import requests Loading Loading @@ -425,7 +429,7 @@ class CSO_PAL_Downloader(object): # create target dir if necessary: cso_file.CheckDir(output_file, dmode=dmode) # move to destination: os.rename(product_file, output_file) shutil.move(product_file, output_file) # all ok, leave retry loop: break Loading