diff --git a/setup.py b/setup.py index 82d04e9..a4ca775 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( version="0.1", packages=find_packages(where="src"), package_dir={"": "src"}, - install_requires=["python-frontmatter, "hurry.filesize"], + install_requires=["python-frontmatter", "termcolor"], entry_points={ "console_scripts": [ "run=app:main", diff --git a/src/services/database_service.py b/src/services/database_service.py index da769bc..cfa36cf 100644 --- a/src/services/database_service.py +++ b/src/services/database_service.py @@ -1,6 +1,8 @@ import sqlite3 from typing import Optional +from termcolor import colored + class DatabaseService: def __init__(self, db_name): @@ -14,11 +16,11 @@ class DatabaseService: try: self.connection = sqlite3.connect(f"{self.db_path}/{self.db_name}.db") - print("INFO Database connection established") + print(colored("INFO Database connection established", "light_blue")) return self.connection except Exception as e: - raise Exception(f"Problem connecting to database: {e}") + raise Exception(f"ERROR Problem connecting to database: {e}") def disconnect(self) -> None: try: diff --git a/src/services/parse_file_service.py b/src/services/parse_file_service.py index f201bb4..e3e537d 100644 --- a/src/services/parse_file_service.py +++ b/src/services/parse_file_service.py @@ -2,7 +2,7 @@ import os from datetime import datetime from pathlib import Path -from hurry.filesize import size +from termcolor import colored from models.entry import Entry from services.parse_markdown_service import ParseMarkdownService @@ -30,7 +30,7 @@ class ParseFileService: } def parse_source_directory(self): - print("INFO Indexing entries in source directory") + print(colored("INFO Indexing entries in source directory", "light_blue")) parsed_entries = [] with os.scandir(self.source_directory) as dir: for file in dir: