remove get_path_file_in_project_root because working dir setting in pycharm exists, lol

This commit is contained in:
norohind 2021-12-14 01:53:40 +03:00
parent 588ab9f581
commit 11152d6b5d
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1
2 changed files with 2 additions and 15 deletions

View File

@ -1,8 +1,6 @@
import sqlite3
from . import sqlite_sql_requests
import json
from pathlib import Path
from utils import get_path_file_in_project_root
class SqliteModel:
@ -14,7 +12,7 @@ class SqliteModel:
:return:
"""
self.db = sqlite3.connect(get_path_file_in_project_root('squads.sqlite'), check_same_thread=False)
self.db = sqlite3.connect('squads.sqlite', check_same_thread=False)
self.db.row_factory = lambda c, r: dict(zip([col[0] for col in c.description], r))
def close_model(self) -> None:

View File

@ -3,7 +3,6 @@ import os
import sqlite3
import time
from typing import Union
from pathlib import Path
import requests
@ -26,20 +25,10 @@ if os.getenv("JUBILANT_TIME_BETWEEN_REQUESTS") is not None:
pass
def get_path_file_in_project_root(filename: str) -> str:
if Path.cwd().name != 'NewSquadsMonitor':
file_path = Path().resolve().parent.joinpath(filename)
else:
file_path = filename
return file_path
logger.debug(f'TIME_BETWEEN_REQUESTS = {TIME_BETWEEN_REQUESTS} {type(TIME_BETWEEN_REQUESTS)}')
with open(get_path_file_in_project_root('available.json'), 'r', encoding='utf-8') as available_file:
with open('available.json', 'r', encoding='utf-8') as available_file:
TAG_COLLECTIONS: dict = json.load(available_file)['SquadronTagData']['SquadronTagCollections']
# proxy: last request time