clean imports
This commit is contained in:
parent
a0d66fb2e5
commit
6bec415540
@ -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 *
|
||||||
|
|
||||||
|
|
||||||
|
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user