mirror of
https://forge.chapril.org/tykayn/mapillary_download
synced 2025-10-09 17:02:46 +02:00
up
This commit is contained in:
parent
cdd4d6e549
commit
a080ab844f
15 changed files with 392 additions and 80 deletions
35
move_already_sent.py
Normal file
35
move_already_sent.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
import os
|
||||
import shutil
|
||||
|
||||
# Définition des chemins
|
||||
found_in_france_path = 'found_in_france'
|
||||
already_sent_path = 'already_sent'
|
||||
|
||||
# Vérification de l'existence des dossiers
|
||||
if not os.path.exists(found_in_france_path):
|
||||
print(f"Le dossier {found_in_france_path} n'existe pas.")
|
||||
exit(1)
|
||||
|
||||
if not os.path.exists(already_sent_path):
|
||||
os.makedirs(already_sent_path)
|
||||
|
||||
# Parcours des sous-dossiers
|
||||
for dir_name in os.listdir(found_in_france_path):
|
||||
dir_path = os.path.join(found_in_france_path, dir_name)
|
||||
# Vérifier si c'est un dossier
|
||||
if os.path.isdir(dir_path):
|
||||
# Rechercher le fichier panoramax.txt dans le dossier
|
||||
file_path = os.path.join(dir_path, '_panoramax.txt')
|
||||
if os.path.exists(file_path):
|
||||
# Déplacer le dossier vers already_sent
|
||||
new_dir_path = os.path.join(already_sent_path, dir_name)
|
||||
try:
|
||||
shutil.move(dir_path, new_dir_path)
|
||||
print(f"Dossier {dir_name} déplacé vers {already_sent_path}")
|
||||
except Exception as e:
|
||||
print(f"Erreur lors du déplacement de {dir_name} : {e}")
|
||||
else:
|
||||
print(f"Aucun fichier panoramax.txt trouvé dans {dir_name}")
|
||||
else:
|
||||
print(f"{dir_name} n'est pas un dossier.")
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue