Update contract_previewer.py
Browse files- contract_previewer.py +67 -104
contract_previewer.py
CHANGED
|
@@ -34,140 +34,103 @@ def preview_contract(contract_type, is_free, author_type, author_info,
|
|
| 34 |
# Initialiser l'aperçu avec le titre
|
| 35 |
apercu = ContractTemplates.get_title(contract_type) + "\n\n"
|
| 36 |
|
| 37 |
-
# Ajouter
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
# Article 1 - Objet
|
| 41 |
-
apercu += "Article 1 – OBJET\n"
|
| 42 |
if "Auteur (droits d'auteur)" in contract_type:
|
| 43 |
-
apercu +=
|
|
|
|
|
|
|
| 44 |
|
| 45 |
if "Image (droit à l'image)" in contract_type:
|
| 46 |
-
apercu +=
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
else:
|
| 54 |
-
apercu += "
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
apercu += "- Le droit de représentation\n\n"
|
| 73 |
-
else:
|
| 74 |
-
apercu += "pour la durée précisée à l'article 3 et moyennant la rémunération précisée à l'article approprié, les droits patrimoniaux suivants :\n\n"
|
| 75 |
-
|
| 76 |
-
# Droits de base
|
| 77 |
-
apercu += "- Le droit de reproduction\n"
|
| 78 |
-
apercu += "- Le droit de représentation\n"
|
| 79 |
-
|
| 80 |
-
# Droits supplémentaires pour les cessions onéreuses
|
| 81 |
-
if "distribution" in additional_rights:
|
| 82 |
-
apercu += "- Le droit de distribution\n"
|
| 83 |
-
|
| 84 |
-
if "usage" in additional_rights:
|
| 85 |
-
apercu += "- Le droit d'usage\n"
|
| 86 |
-
|
| 87 |
-
if "adaptation" in additional_rights:
|
| 88 |
-
apercu += "- Le droit d'adaptation\n"
|
| 89 |
-
|
| 90 |
-
if "pret" in additional_rights:
|
| 91 |
-
apercu += "- Le droit de prêt\n"
|
| 92 |
-
|
| 93 |
-
if "location" in additional_rights:
|
| 94 |
-
apercu += "- Le droit de location\n"
|
| 95 |
-
|
| 96 |
-
if "suite" in additional_rights:
|
| 97 |
-
apercu += "- Le droit de suite (pour œuvres graphiques et plastiques)\n"
|
| 98 |
-
|
| 99 |
-
apercu += "\n"
|
| 100 |
-
|
| 101 |
-
# Clause d'exclusivité
|
| 102 |
-
if is_exclusive:
|
| 103 |
-
apercu += "Pendant la durée de la présente cession, l'Auteur s'engage à ne pas céder les mêmes droits à des tiers et à ne pas exploiter lui-même l'œuvre selon les modalités cédées au Cessionnaire.\n\n"
|
| 104 |
-
else:
|
| 105 |
-
apercu += "La présente cession étant non exclusive, l'Auteur conserve le droit d'exploiter l'œuvre et de céder les mêmes droits à des tiers.\n\n"
|
| 106 |
-
|
| 107 |
-
article_num += 1
|
| 108 |
|
| 109 |
-
# Article pour les droits à l'image
|
| 110 |
if "Image (droit à l'image)" in contract_type:
|
| 111 |
-
|
| 112 |
-
apercu += f"
|
| 113 |
-
|
| 114 |
-
apercu += "Le Modèle autorise le Cessionnaire à fixer, reproduire et communiquer au public son image. "
|
| 115 |
-
apercu += "Cette autorisation est consentie "
|
| 116 |
-
|
| 117 |
-
if is_exclusive:
|
| 118 |
-
apercu += "à titre exclusif, "
|
| 119 |
-
else:
|
| 120 |
-
apercu += "à titre non exclusif, "
|
| 121 |
-
|
| 122 |
-
if is_free:
|
| 123 |
-
apercu += "gratuitement, "
|
| 124 |
-
else:
|
| 125 |
-
apercu += "moyennant la rémunération précisée à l'article approprié, "
|
| 126 |
-
|
| 127 |
-
apercu += "pour la durée et sur le territoire mentionnés ci-après.\n\n"
|
| 128 |
-
|
| 129 |
-
apercu += "Le Cessionnaire s'engage expressément à ne pas porter atteinte à la dignité, à l'honneur ou à la réputation du Modèle. "
|
| 130 |
-
apercu += "Les parties s'engagent mutuellement à ne pas tenir de propos dénigrants l'une envers l'autre.\n\n"
|
| 131 |
-
|
| 132 |
-
if is_exclusive:
|
| 133 |
-
apercu += "Le Modèle s'engage à ne pas autoriser l'exploitation de son image à des tiers pendant la durée du présent contrat.\n\n"
|
| 134 |
-
else:
|
| 135 |
-
apercu += "La présente autorisation étant non exclusive, le Modèle conserve le droit d'autoriser l'exploitation de son image à des tiers.\n\n"
|
| 136 |
-
|
| 137 |
article_num += 1
|
| 138 |
|
| 139 |
-
|
| 140 |
-
apercu += f"Article {article_num} – DURÉE ET TERRITOIRE\n"
|
| 141 |
apercu += "Durée : 1 an, renouvelable par tacite reconduction\n"
|
| 142 |
apercu += "Territoire : monde entier\n\n"
|
| 143 |
-
|
| 144 |
article_num += 1
|
| 145 |
-
|
|
|
|
| 146 |
supports_str = ", ".join(final_supports)
|
| 147 |
apercu += f"Supports autorisés : {supports_str}\n\n"
|
| 148 |
-
|
| 149 |
article_num += 1
|
| 150 |
-
|
|
|
|
| 151 |
if is_free:
|
| 152 |
apercu += "La présente cession est consentie à titre gratuit.\n\n"
|
| 153 |
else:
|
| 154 |
apercu += f"Rémunération : {sanitize_text(remuneration)}\n\n"
|
|
|
|
| 155 |
|
| 156 |
-
#
|
|
|
|
| 157 |
article_num += 1
|
| 158 |
-
apercu += f"
|
| 159 |
article_num += 1
|
| 160 |
-
apercu += f"
|
| 161 |
article_num += 1
|
| 162 |
-
apercu += f"
|
| 163 |
|
| 164 |
apercu += "Fait à ________________, le ________________\n\n"
|
|
|
|
| 165 |
|
| 166 |
if "Auteur (droits d'auteur)" in contract_type and "Image (droit à l'image)" in contract_type:
|
| 167 |
-
apercu += "
|
| 168 |
elif "Auteur (droits d'auteur)" in contract_type:
|
| 169 |
-
apercu += "
|
| 170 |
else:
|
| 171 |
-
apercu += "
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
return apercu
|
|
|
|
| 34 |
# Initialiser l'aperçu avec le titre
|
| 35 |
apercu = ContractTemplates.get_title(contract_type) + "\n\n"
|
| 36 |
|
| 37 |
+
# Ajouter un extrait du préambule (simplifié pour l'aperçu)
|
| 38 |
+
preamble_parts = ContractTemplates.get_preamble_text(contract_type, author_type, author_info).split("\n\n")
|
| 39 |
+
|
| 40 |
+
# Première partie du préambule (partie "ENTRE LES SOUSSIGNÉS" et infos parties)
|
| 41 |
+
for i in range(min(6, len(preamble_parts))):
|
| 42 |
+
if preamble_parts[i].strip():
|
| 43 |
+
apercu += preamble_parts[i] + "\n\n"
|
| 44 |
+
|
| 45 |
+
# Sauter au "CECI EXPOSÉ, IL A ÉTÉ CONVENU CE QUI SUIT :"
|
| 46 |
+
for part in preamble_parts:
|
| 47 |
+
if "CONVENU CE QUI SUIT" in part:
|
| 48 |
+
apercu += part + "\n\n"
|
| 49 |
+
break
|
| 50 |
+
|
| 51 |
+
# Article 1 - Objet (extrait)
|
| 52 |
+
apercu += "ARTICLE 1 – OBJET DU CONTRAT\n\n"
|
| 53 |
|
|
|
|
|
|
|
| 54 |
if "Auteur (droits d'auteur)" in contract_type:
|
| 55 |
+
apercu += "1.1 Œuvre concernée\n\n"
|
| 56 |
+
apercu += f"L'Auteur déclare être le créateur et titulaire exclusif des droits d'auteur sur l'œuvre suivante :\n\n"
|
| 57 |
+
apercu += f"{sanitize_text(work_description)}\n\n"
|
| 58 |
|
| 59 |
if "Image (droit à l'image)" in contract_type:
|
| 60 |
+
apercu += "1.2 Images concernées\n\n"
|
| 61 |
+
apercu += f"Le Modèle autorise l'utilisation et l'exploitation de son image telle qu'elle apparaît dans les photographies/vidéos suivantes :\n\n"
|
| 62 |
+
apercu += f"{sanitize_text(image_description)}\n\n"
|
| 63 |
|
| 64 |
+
# Article 2 - Droits cédés (extrait)
|
| 65 |
+
apercu += "ARTICLE 2 – ÉTENDUE DES DROITS CÉDÉS\n\n"
|
| 66 |
+
apercu += "2.1 Nature de la cession\n\n"
|
| 67 |
+
apercu += "L'Auteur cède au Cessionnaire, "
|
| 68 |
+
|
| 69 |
+
if is_exclusive:
|
| 70 |
+
apercu += "à titre exclusif, "
|
| 71 |
else:
|
| 72 |
+
apercu += "à titre non exclusif, "
|
| 73 |
|
| 74 |
+
if is_free:
|
| 75 |
+
apercu += "gratuitement et pour la durée précisée à l'article 4, les droits patrimoniaux suivants.\n\n"
|
| 76 |
+
else:
|
| 77 |
+
apercu += "pour la durée précisée à l'article 4 et moyennant rémunération, les droits patrimoniaux détaillés au contrat.\n\n"
|
| 78 |
|
| 79 |
+
apercu += "2.2 Droits patrimoniaux cédés\n\n"
|
| 80 |
+
apercu += "Droits de base : reproduction et représentation"
|
| 81 |
+
|
| 82 |
+
if not is_free and additional_rights:
|
| 83 |
+
apercu += "\nDroits supplémentaires inclus :"
|
| 84 |
+
for right in additional_rights:
|
| 85 |
+
right_name = right.split(" - ")[0] if " - " in right else right
|
| 86 |
+
apercu += f"\n- {right_name}"
|
| 87 |
+
|
| 88 |
+
apercu += "\n\n"
|
| 89 |
+
|
| 90 |
+
# Pour l'aperçu, ajouter les titres des autres articles
|
| 91 |
+
article_num = 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
|
|
|
| 93 |
if "Image (droit à l'image)" in contract_type:
|
| 94 |
+
apercu += f"ARTICLE {article_num} – AUTORISATION D'EXPLOITATION DE L'IMAGE\n"
|
| 95 |
+
apercu += f"(Les détails complets seront inclus dans le contrat final)\n\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
article_num += 1
|
| 97 |
|
| 98 |
+
apercu += f"ARTICLE {article_num} – DURÉE ET TERRITOIRE\n"
|
|
|
|
| 99 |
apercu += "Durée : 1 an, renouvelable par tacite reconduction\n"
|
| 100 |
apercu += "Territoire : monde entier\n\n"
|
|
|
|
| 101 |
article_num += 1
|
| 102 |
+
|
| 103 |
+
apercu += f"ARTICLE {article_num} – SUPPORTS D'EXPLOITATION\n"
|
| 104 |
supports_str = ", ".join(final_supports)
|
| 105 |
apercu += f"Supports autorisés : {supports_str}\n\n"
|
|
|
|
| 106 |
article_num += 1
|
| 107 |
+
|
| 108 |
+
apercu += f"ARTICLE {article_num} – RÉMUNÉRATION\n"
|
| 109 |
if is_free:
|
| 110 |
apercu += "La présente cession est consentie à titre gratuit.\n\n"
|
| 111 |
else:
|
| 112 |
apercu += f"Rémunération : {sanitize_text(remuneration)}\n\n"
|
| 113 |
+
article_num += 1
|
| 114 |
|
| 115 |
+
# Résumé des articles restants
|
| 116 |
+
apercu += f"ARTICLE {article_num} – GARANTIES ET RESPONSABILITÉS\n"
|
| 117 |
article_num += 1
|
| 118 |
+
apercu += f"ARTICLE {article_num} – RÉSILIATION\n"
|
| 119 |
article_num += 1
|
| 120 |
+
apercu += f"ARTICLE {article_num} – DISPOSITIONS DIVERSES\n"
|
| 121 |
article_num += 1
|
| 122 |
+
apercu += f"ARTICLE {article_num} – LOI APPLICABLE ET JURIDICTION COMPÉTENTE\n\n"
|
| 123 |
|
| 124 |
apercu += "Fait à ________________, le ________________\n\n"
|
| 125 |
+
apercu += "En deux exemplaires originaux.\n\n"
|
| 126 |
|
| 127 |
if "Auteur (droits d'auteur)" in contract_type and "Image (droit à l'image)" in contract_type:
|
| 128 |
+
apercu += "Pour l'Auteur et Modèle Pour le Cessionnaire"
|
| 129 |
elif "Auteur (droits d'auteur)" in contract_type:
|
| 130 |
+
apercu += "Pour l'Auteur Pour le Cessionnaire"
|
| 131 |
else:
|
| 132 |
+
apercu += "Pour le Modèle Pour le Cessionnaire"
|
| 133 |
+
|
| 134 |
+
apercu += "\n\nCet aperçu est une version simplifiée. Le contrat final sera plus détaillé et juridiquement complet."
|
| 135 |
|
| 136 |
+
return apercu
|