From 224c095b6c020c20e72ff7779d959b1b6720116c Mon Sep 17 00:00:00 2001 From: Jeel Dobariya Date: Tue, 7 Nov 2023 19:50:57 +0530 Subject: [PATCH] fixed some bugs with mypy --- src/app/datahandler.py | 2 +- src/app/metadata.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/datahandler.py b/src/app/datahandler.py index 3a7f4fb..8f1f934 100644 --- a/src/app/datahandler.py +++ b/src/app/datahandler.py @@ -9,7 +9,7 @@ def save_data(website: str, password: str) -> None: with open(DATA_FILE, "a") as f: f.write(data + '\n') -def load_data() -> List[str]: +def load_data() -> List[list[str]]: data_list = [] with open(DATA_FILE) as f: data = f.read() diff --git a/src/app/metadata.py b/src/app/metadata.py index 027d238..8e2405e 100644 --- a/src/app/metadata.py +++ b/src/app/metadata.py @@ -1,6 +1,7 @@ """CHANGES IN THIS FILE CAN LEAD TO ADVERSE EFFECTS AND CAN EVEN CRASH THE APPLICATION""" import os +from typing import List # App NAME: str = "Smart Manager" @@ -9,8 +10,8 @@ REPO: str = "https://github.com/JeelDobariya38/Smart-Manager" # Paths (all path are relative to this file) -__DATADIR: str = ["..", "..", "..", "data"] -__RESOURCEDIR: str = ["..", "..", "..", "resource"] +__DATADIR: list[str] = ["..", "..", "..", "data"] +__RESOURCEDIR: list[str] = ["..", "..", "..", "resource"] # FilePath (Do Not Change this session, instead change above "Paths" session) DATADIR_PATH: str = os.path.join(__file__, os.path.sep.join(__DATADIR)) + os.path.sep