Clean du code grâce à ruff

This commit is contained in:
Jean-Marie Favreau
2025-03-02 19:12:50 +01:00
parent d8c4c55c44
commit b5d4c0f0b1
225 changed files with 3748 additions and 1790 deletions

View File

@@ -1,40 +1,40 @@
#!/usr/bin/python3
# coding: utf-8
import os
import json
import os
import sys
# getting the name of the directory
# where the this file is present.
current = os.path.dirname(os.path.realpath(__file__))
# Getting the parent directory name
# where the current directory is present.
parent = os.path.dirname(current)
# adding the parent directory to
# adding the parent directory to
# the sys.path.
sys.path.append(parent)
sys.path.append(parent + "/src")
from src.agenda_culturel.import_tasks.downloader import *
from src.agenda_culturel.import_tasks.extractor import *
from src.agenda_culturel.import_tasks.importer import *
from src.agenda_culturel.import_tasks.custom_extractors import *
from src.agenda_culturel.import_tasks.custom_extractors import lerio
from src.agenda_culturel.import_tasks.downloader import SimpleDownloader
from src.agenda_culturel.import_tasks.importer import URL2Events
if __name__ == "__main__":
u2e = URL2Events(SimpleDownloader(), lerio.CExtractor())
url = "https://www.cinemalerio.com/evenements/"
url_human = "https://www.cinemalerio.com/evenements/"
try:
events = u2e.process(url, url_human, cache = "cache-le-rio.html", default_values = {"location": "Cinéma le Rio", "category": "Cinéma"}, published = True)
events = u2e.process(
url,
url_human,
cache="cache-le-rio.html",
default_values={"location": "Cinéma le Rio", "category": "Cinéma"},
published=True,
)
exportfile = "events-le-roi.json"
print("Saving events to file {}".format(exportfile))