Refactor : apply clarity feedback from last merge request comments
This commit is contained in:
parent
3ecc7b75c8
commit
28b879720f
@ -22,6 +22,8 @@ FOLDERNAMES = [
|
|||||||
"7_Plans_de_secteur",
|
"7_Plans_de_secteur",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
ANNEXE_FOLDER_ID = 4
|
||||||
|
|
||||||
# Les mots clef associés à chaque dossier
|
# Les mots clef associés à chaque dossier
|
||||||
KEYWORDS = {
|
KEYWORDS = {
|
||||||
"Jugement": FOLDERNAMES[0],
|
"Jugement": FOLDERNAMES[0],
|
||||||
@ -72,7 +74,7 @@ def test_siren_insee(is_plu: bool, number: str):
|
|||||||
|
|
||||||
def create_folders(is_plu: bool, prefixe, suffixe):
|
def create_folders(is_plu: bool, prefixe, suffixe):
|
||||||
"""Crée l'arborescence"""
|
"""Crée l'arborescence"""
|
||||||
main_path = prefixe + "_" + ("PLU" if is_plu else "PLUi") + "_" + suffixe
|
main_path = f"{prefixe}_PLU{"i" if not is_plu else ""}_{suffixe}"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.mkdir(main_path)
|
os.mkdir(main_path)
|
||||||
@ -177,7 +179,7 @@ def sort_files(prefixe, suffixe, sort_path):
|
|||||||
+ ".pdf",
|
+ ".pdf",
|
||||||
)
|
)
|
||||||
os.rename(file, renamed)
|
os.rename(file, renamed)
|
||||||
shutil.move(renamed, sort_path + "/" + FOLDERNAMES[4])
|
shutil.move(renamed, sort_path + "/" + FOLDERNAMES[ANNEXE_FOLDER_ID])
|
||||||
|
|
||||||
return keyword_count
|
return keyword_count
|
||||||
# return True
|
# return True
|
||||||
@ -246,9 +248,3 @@ def sortout():
|
|||||||
donees_fichiers = sort_files(prefixe, suffixe, main_path)
|
donees_fichiers = sort_files(prefixe, suffixe, main_path)
|
||||||
|
|
||||||
error_report(donees_fichiers)
|
error_report(donees_fichiers)
|
||||||
# Chargement
|
|
||||||
# for i in range(100):
|
|
||||||
# print(f"{i}%")
|
|
||||||
# time.sleep(0.5)
|
|
||||||
# if i <100:
|
|
||||||
# print("\033[A\033[K", end="")
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user