clean imports

This commit is contained in:
Guilhem Fauré 2023-04-25 09:56:03 +02:00
parent a0d66fb2e5
commit 6bec415540
2 changed files with 5 additions and 7 deletions

View File

@ -2,7 +2,6 @@ import re
import yaml import yaml
from slugify import slugify from slugify import slugify
# Modules
from SpipDatabase import * from SpipDatabase import *

View File

@ -1,17 +1,16 @@
#!python3 #!python3
import os
import shutil
import sys import sys
from os import mkdir
from shutil import rmtree
# from datetime import date, datetime, time
from config import CONFIG from config import CONFIG
from content import content from content import content
from metadata import metadata from metadata import metadata
from SpipDatabase import * from SpipDatabase import *
# Clean the output dir & create a new # Clean the output dir & create a new
shutil.rmtree(CONFIG["outputDir"], True) rmtree(CONFIG["outputDir"], True)
os.mkdir(CONFIG["outputDir"]) mkdir(CONFIG["outputDir"])
# Connect to the MySQL database with Peewee ORM # Connect to the MySQL database with Peewee ORM
db.connect() db.connect()
@ -44,7 +43,7 @@ for article in articles:
print(f" in {meta.get_slug()}/index.md") print(f" in {meta.get_slug()}/index.md")
body = content(article.texte) body = content(article.texte)
articleDir = "{}/{}".format(CONFIG["outputDir"], meta.get_slug()) articleDir = "{}/{}".format(CONFIG["outputDir"], meta.get_slug())
os.mkdir(articleDir) mkdir(articleDir)
with open("{}/index.md".format(articleDir), "w") as f: with open("{}/index.md".format(articleDir), "w") as f:
f.write( f.write(
"{}\n{}\n{}\n{}".format( "{}\n{}\n{}\n{}".format(