fix: sort file by name
This commit is contained in:
parent
bb29eb2b73
commit
df05678ddc
10
src/path.py
10
src/path.py
@ -42,7 +42,10 @@ class Path():
|
||||
|
||||
def get_dirs(self) -> list[Path]:
|
||||
dirs: list[Path] = []
|
||||
for element in os.listdir(self.get_absolute_path()):
|
||||
elements = os.listdir(self.get_absolute_path())
|
||||
elements.sort()
|
||||
elements.reverse()
|
||||
for element in elements:
|
||||
path: Path = Path(self._absolute_path, element)
|
||||
if (os.path.isdir(path.get_absolute_path())):
|
||||
dirs.append(path)
|
||||
@ -50,7 +53,10 @@ class Path():
|
||||
|
||||
def get_files(self) -> list[Path]:
|
||||
files: list[Path] = []
|
||||
for element in os.listdir(self.get_absolute_path()):
|
||||
elements = os.listdir(self.get_absolute_path())
|
||||
elements.sort()
|
||||
elements.reverse()
|
||||
for element in elements:
|
||||
path: Path = Path(self._absolute_path, element)
|
||||
if (os.path.isfile(path.get_absolute_path())):
|
||||
files.append(path)
|
||||
|
@ -34,6 +34,7 @@ def main():
|
||||
copy_info: dict[str, str] = get_copy_info(copy_path)
|
||||
files: list[str] = [os.path.join(input_folder, f) for f in os.listdir(input_folder)]
|
||||
files = [f for f in files if os.path.isfile(f) and f.endswith(".NEF")]
|
||||
files.sort()
|
||||
with Bar("copying...", max=len(files)) as bar:
|
||||
for file in files:
|
||||
with open(file, 'rb') as f:
|
||||
|
Loading…
Reference in New Issue
Block a user