mirror of
https://github.com/norohind/jubilant-system.git
synced 2025-04-20 16:07:36 +03:00
remove get_path_file_in_project_root because working dir setting in pycharm exists, lol
This commit is contained in:
parent
588ab9f581
commit
11152d6b5d
@ -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:
|
||||
|
13
utils.py
13
utils.py
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user