diff --git a/CHANGELOG.org b/CHANGELOG.org index ca2b1e1..fd7f396 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -29,3 +29,5 @@ Added TOML configuration file. Updated paths of files and folders. Updated my name to my fullname and release years. +** 1.0.2 <2023-01-15> + Refactor the database class and remove function for the creating file. diff --git a/src/db.py b/src/db.py index 21b2a44..cead782 100644 --- a/src/db.py +++ b/src/db.py @@ -29,22 +29,8 @@ class DataBase: def __init__(self, PATH: str = "user.db", TABLE: str = "animes"): """Initialising the connection information.""" self.PATH, self.TABLE = PATH, TABLE - self.database_is_exists() self.create_table(self.TABLE) - def database_is_exists(self): - """Creates DB file if not exists.""" - try: - f = open(self.PATH, 'r') - f.close() - except FileNotFoundError: - f = open(self.PATH, 'w') - f.close() - except Exception as e: - print(f"{e=}") - finally: - pass - def create_table(self, table): """Create a table in the DB.""" connect = sqlite3.connect(self.PATH)