From 9f94a3224cdda7cc28a841899d1d097efe0d74d5 Mon Sep 17 00:00:00 2001 From: slivering <47292273+slivering@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:52:49 +0100 Subject: [PATCH] Formatage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Utiliser les guillemets doubles systématiquement --- __main__.py | 72 ++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/__main__.py b/__main__.py index e3f917f..5135912 100644 --- a/__main__.py +++ b/__main__.py @@ -10,14 +10,14 @@ dir_util = setuptools.distutils.dir_util -MAIN_SITE_URL = 'https://piaf-saclay.org' -BLOG_URL = 'https://blog.piaf-saclay.org' -YOUTUBE_CHANNEL = 'https://www.youtube.com/@GROUPE-PIAF' -GITHUB_PAGE = 'https://github.com/ai-safety-saclay' -DISCORD_SERVER = 'https://discord.gg/pWRjGuP4nE' +MAIN_SITE_URL = "https://piaf-saclay.org" +BLOG_URL = "https://blog.piaf-saclay.org" +YOUTUBE_CHANNEL = "https://www.youtube.com/@GROUPE-PIAF" +GITHUB_PAGE = "https://github.com/ai-safety-saclay" +DISCORD_SERVER = "https://discord.gg/pWRjGuP4nE" -KEYWORDS = 'IA, intelligence artificielle, fiable, association, école, étudiant, ingénieur, Saclay, conférence, Asimov, hackathon, recherche, numérique, dangers, sécurité, fiabilité, robustesse, sûreté, confiance, alignement, contrôle' -DESCRIPTION = 'Le PIAF est une association qui réunit des étudiants du plateau de Saclay autour de l\'intelligence artificielle fiable. Groupe de lecture, conférences, hackathons, et bien d\'autres projets.' +KEYWORDS = "IA, intelligence artificielle, fiable, association, école, étudiant, ingénieur, Saclay, conférence, Asimov, hackathon, recherche, numérique, dangers, sécurité, fiabilité, robustesse, sûreté, confiance, alignement, contrôle" +DESCRIPTION = "Le PIAF est une association qui réunit des étudiants du plateau de Saclay autour de l'intelligence artificielle fiable. Groupe de lecture, conférences, hackathons, et bien d'autres projets." GLOBALS = { "MAIN_SITE_URL": MAIN_SITE_URL, @@ -36,11 +36,11 @@ def read_yml(path: str) -> dict: - with open(path, 'r') as f: + with open(path, "r") as f: return yaml.safe_load(f) def write_html(path: str, template): - with open(f"build/{path}", 'w') as f: + with open(f"build/{path}", "w") as f: f.write(template.render()) def generate_home(): @@ -49,7 +49,7 @@ def generate_home(): template = env.get_template("home.html", globals={"page": page, "title": title}) - write_html('index.html', template) + write_html("index.html", template) def generate_page(title, template_path, **globals): @@ -63,18 +63,18 @@ def generate_page(title, template_path, **globals): ASIMOV_VIDEO_IDS = [ - 'd9tjp4-xJG4?start=2461', # Alexei Grinbaum - 'dp5Yga_WKng?start=337', # Asma Mhalla - 'c-MQPOoM6-E?start=2493', # Fabrice Epelboin - 'FhFxlZzptys?start=1318', # David Chavalarias - 'CoX5OZIbGl4?start=187', # Maxime Fournes - 'ofs-9_yzcvY?start=449', # Alain Damasio - 'LZWr5OZyBWE?start=849', # Raja Chatila - 'sPyu_dTSma0?start=509', # Caroline Jeanmaire + "d9tjp4-xJG4?start=2461", # Alexei Grinbaum + "dp5Yga_WKng?start=337", # Asma Mhalla + "c-MQPOoM6-E?start=2493", # Fabrice Epelboin + "FhFxlZzptys?start=1318", # David Chavalarias + "CoX5OZIbGl4?start=187", # Maxime Fournes + "ofs-9_yzcvY?start=449", # Alain Damasio + "LZWr5OZyBWE?start=849", # Raja Chatila + "sPyu_dTSma0?start=509", # Caroline Jeanmaire ] md_configs = { - 'mdx_wikilink_plus': { + "mdx_wikilink_plus": { "url_whitespace": "%20", }, "mdx_math": { @@ -82,12 +82,12 @@ def generate_page(title, template_path, **globals): } } -md = Markdown(extensions=['mdx_math', 'fenced_code', 'tables', 'full_yaml_metadata', 'mdx_wikilink_plus', 'markdown_gfm_admonition', 'nl2br'], extension_configs=md_configs) +md = Markdown(extensions=["mdx_math", "fenced_code", "tables", "full_yaml_metadata", "mdx_wikilink_plus", "markdown_gfm_admonition", "nl2br"], extension_configs=md_configs) def generate_blog(): for filename in os.listdir("blog"): if filename.endswith(".md"): - with open("blog/"+filename, 'r') as f: + with open("blog/"+filename, "r") as f: text_content = f.read() #content = Markup(md.convert(text_content)) content = md.convert(text_content) @@ -104,37 +104,37 @@ def generate_blog(): -if __name__ == '__main__': - # if 'build' folder does not exist, create it, copy content of 'static' folder to it +if __name__ == "__main__": + # if "build" folder does not exist, create it, copy content of "static" folder to it # and generate html # if build folder exists, delete it - if os.path.exists('./build'): - dir_util.remove_tree('./build') + if os.path.exists("./build"): + dir_util.remove_tree("./build") - if not os.path.exists('./bootstrap'): + if not os.path.exists("./bootstrap"): Repo.clone_from( - 'https://github.com/twbs/bootstrap', - 'bootstrap', - multi_options=['--depth=1', '--branch=v5.3.3'], + "https://github.com/twbs/bootstrap", + "bootstrap", + multi_options=["--depth=1", "--branch=v5.3.3"], ) Repo.clone_from( - 'https://github.com/twbs/icons', - 'bootstrap-icons', - multi_options=['--depth=1', '--branch=v1.11.3'], + "https://github.com/twbs/icons", + "bootstrap-icons", + multi_options=["--depth=1", "--branch=v1.11.3"], ) - dir_util.copy_tree('./static', './build') + dir_util.copy_tree("./static", "./build") dir_util.copy_tree("blog/documents", "build/blog") - sass.compile(dirname=('scss', 'build')) + sass.compile(dirname=("scss", "build")) - dir_util.copy_tree('./bootstrap-icons/font/fonts', './build/fonts') + dir_util.copy_tree("./bootstrap-icons/font/fonts", "./build/fonts") generate_home() generate_page("Asimov : les dangers du numérique", "asimov.html", video_ids=ASIMOV_VIDEO_IDS) - lectures = reversed(read_yml('lectures.yml')) + lectures = reversed(read_yml("lectures.yml")) generate_page("Notre groupe de lecture", "groupe-de-lecture.html", lectures=lectures) generate_page("Politique de confidentialité", "confidentialite.md")