Feat : Visual improvement and some useless data suppression for error report
This commit is contained in:
parent
f72c04ec2d
commit
8d8987ee15
@ -203,39 +203,35 @@ def error_report(file_data,folder_data):
|
|||||||
Crée le rapport d'utilisation du script
|
Crée le rapport d'utilisation du script
|
||||||
"""
|
"""
|
||||||
#Couleur rouge
|
#Couleur rouge
|
||||||
error_color =PatternFill(patternType='solid',fgColor='00FF0000')
|
error_color = PatternFill(patternType='solid',fgColor='00cb4335')
|
||||||
|
column_name_color = PatternFill(patternType='solid',fgColor='0085929e')
|
||||||
|
row_color = PatternFill(patternType='solid',fgColor='00ccd1d1')
|
||||||
|
|
||||||
report = xls.Workbook()
|
report = xls.Workbook()
|
||||||
report_worsheet = report.active
|
report_worsheet = report.active
|
||||||
report_worsheet.title = "Compte rendu"
|
report_worsheet.title = "Compte rendu"
|
||||||
report_worsheet['A1'] = "Fichiers trouvés"
|
report_worsheet['B1'] = "Dossiers"
|
||||||
report_worsheet['B1'] = "Occurences"
|
report_worsheet['C1'] = "NB Fichiers"
|
||||||
report_worsheet['F1'] = "Dossiers"
|
report_worsheet['D1'] = "Rapport d'erreur"
|
||||||
report_worsheet['G1'] = "Fichiers contenus"
|
|
||||||
|
|
||||||
report_worsheet.column_dimensions['A'].width *= 3
|
|
||||||
report_worsheet.column_dimensions['B'].width *= 3
|
report_worsheet.column_dimensions['B'].width *= 3
|
||||||
report_worsheet.column_dimensions['F'].width *= 3
|
report_worsheet.column_dimensions['C'].width *= 3
|
||||||
report_worsheet.column_dimensions['G'].width *= 3
|
report_worsheet.column_dimensions['D'].width *= 3
|
||||||
report_worsheet.column_dimensions['H'].width *= 3
|
|
||||||
|
|
||||||
currrent_cell = 2
|
report_worsheet['B1'].fill = report_worsheet['C1'].fill = report_worsheet['D1'].fill = column_name_color
|
||||||
for key in file_data:
|
|
||||||
report_worsheet['A'+ str(currrent_cell)] = key
|
|
||||||
report_worsheet['B'+ str(currrent_cell)] = file_data.get(key)
|
|
||||||
currrent_cell+=1
|
|
||||||
|
|
||||||
currrent_cell = 2
|
currrent_cell = 2
|
||||||
for i, content in enumerate(folder_data):
|
for i, content in enumerate(folder_data):
|
||||||
report_worsheet['F'+ str(currrent_cell)] = FOLDERNAMES[i]
|
report_worsheet['B'+ str(currrent_cell)] = FOLDERNAMES[i]
|
||||||
report_worsheet['G'+ str(currrent_cell)] = content
|
report_worsheet['C'+ str(currrent_cell)] = content
|
||||||
|
if i % 2 == 0:
|
||||||
|
report_worsheet['B'+ str(currrent_cell)].fill = report_worsheet['C'+ str(currrent_cell)].fill = report_worsheet['D'+ str(currrent_cell)].fill = row_color
|
||||||
|
|
||||||
if content == 0:
|
if content == 0:
|
||||||
report_worsheet['H'+ str(currrent_cell)] = "/!\\ aucun fichier dans le dossier /!\\"
|
report_worsheet['D'+ str(currrent_cell)] = "/!\\ aucun fichier dans le dossier /!\\"
|
||||||
report_worsheet['H'+ str(currrent_cell)].fill = error_color
|
report_worsheet['D'+ str(currrent_cell)].fill = error_color
|
||||||
currrent_cell+=1
|
currrent_cell+=1
|
||||||
|
|
||||||
report_worsheet['A'+str(3 + len(file_data.keys()))] = "Total fichiers"
|
|
||||||
report_worsheet['B'+str(3 + len(file_data.keys()))] = '=SUM(B2:B' + str(1 + len(file_data.keys())) + ')'
|
|
||||||
report.save("Rapport.xlsx")
|
report.save("Rapport.xlsx")
|
||||||
|
|
||||||
def sortout():
|
def sortout():
|
||||||
@ -255,7 +251,6 @@ def sortout():
|
|||||||
is_plu = answer == 1
|
is_plu = answer == 1
|
||||||
if confirm_choice("PLU" if answer == 1 else "PLUi"):
|
if confirm_choice("PLU" if answer == 1 else "PLUi"):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
# On demande le numero INSEE ou SIREN tant que l'input est invalide
|
# On demande le numero INSEE ou SIREN tant que l'input est invalide
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user