jekyll-to-hugo/app/main.py

30 lines
640 B
Python
Raw Permalink Normal View History

2023-05-29 18:35:38 +00:00
import logging
from app.config import Configurator, ensure_config_exists
2023-05-29 18:35:38 +00:00
from app.converter import Converter
def main():
2023-06-05 10:52:29 +00:00
"""
Main function of the program.
"""
2023-05-29 18:58:32 +00:00
# Configurator
ensure_config_exists()
2023-05-29 18:58:32 +00:00
configurator = Configurator()
2023-05-29 18:35:38 +00:00
# Logging configuration
logging.basicConfig(
format="%(asctime)s %(process)d %(levelname)s %(message)s",
2023-05-29 18:58:32 +00:00
level=configurator.logging_level,
2023-05-29 18:35:38 +00:00
datefmt="%Y-%m-%d %H:%M:%S",
)
# Converter
2023-05-29 18:58:32 +00:00
converter = Converter(configurator)
2023-05-29 18:35:38 +00:00
converter.convert()
# Press the green button in the gutter to run the script.
if __name__ == "__main__":
main()