[HandBrake_recursive] Ajouter un lien vers les fichiers de destination et définir la nouvelle feuille comme active
This commit is contained in:
parent
efa7127914
commit
d31104a4f0
@ -96,7 +96,7 @@ def set_column_width(ws, column_range, width=15):
|
||||
for col in column_range:
|
||||
ws.column_dimensions[col].width = width
|
||||
|
||||
def export_xlsx(lignes, fichier_sortie="résumé.xlsx"):
|
||||
def export_xlsx(lignes, output_directory, fichier_sortie="résumé.xlsx"):
|
||||
# Charger le classeur existant ou en créer un nouveau
|
||||
if os.path.exists(fichier_sortie):
|
||||
wb = openpyxl.load_workbook(fichier_sortie)
|
||||
@ -109,6 +109,9 @@ def export_xlsx(lignes, fichier_sortie="résumé.xlsx"):
|
||||
# Créer une nouvelle feuille
|
||||
ws = wb.create_sheet(title=date)
|
||||
|
||||
# Définir la nouvelle feuille comme active
|
||||
wb.active = ws
|
||||
|
||||
# En-têtes
|
||||
headers = ["Fichier", "Codec", "Résolution", "Action", "Durée", "Taille SRC", "Bitrate SRC",
|
||||
"Taille DES", "Bitrate DES", "Gain %", "Résultat"]
|
||||
@ -143,7 +146,7 @@ def export_xlsx(lignes, fichier_sortie="résumé.xlsx"):
|
||||
gain_percent = calc_gain_percent(input_size, output_size, raw=True)
|
||||
|
||||
row = [
|
||||
file, # string
|
||||
f'=HYPERLINK("{os.path.abspath(output_directory)}/{file}","{file}")', # string
|
||||
codec, # string
|
||||
resolution, # string
|
||||
action, # string
|
||||
@ -550,7 +553,7 @@ def main():
|
||||
))
|
||||
|
||||
xlsx_file = "résumé.xlsx"
|
||||
export_xlsx(lignes, fichier_sortie=xlsx_file)
|
||||
export_xlsx(lignes, output_directory, fichier_sortie=xlsx_file)
|
||||
print(f"📝 Classeur généré : {xlsx_file}")
|
||||
|
||||
lever_inhibit_arret(inhibiteurs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user