[Mod] 改变路径相关函数的命名

This commit is contained in:
nanoric 2019-04-11 00:45:15 -04:00
parent 70adba7637
commit 95df49c54c
2 changed files with 6 additions and 8 deletions

View File

@ -24,7 +24,7 @@ from .widget import (
AboutDialog,
)
from ..engine import MainEngine
from ..utility import get_icon_path, TRADER_PATH
from ..utility import get_icon_path, TRADER_DIR
class MainWindow(QtWidgets.QMainWindow):
@ -38,7 +38,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.main_engine = main_engine
self.event_engine = event_engine
self.window_title = f"VN Trader [{TRADER_PATH}]"
self.window_title = f"VN Trader [{TRADER_DIR}]"
self.connect_dialogs = {}
self.widgets = {}

View File

@ -31,7 +31,7 @@ class Singleton(type):
return cls._instances[cls]
def get_path(temp_name: str):
def _get_trader_dir(temp_name: str):
"""
Get path where trader is running in.
"""
@ -54,21 +54,21 @@ def get_path(temp_name: str):
return home_path, temp_path
TRADER_PATH, TEMP_PATH = get_path(".vntrader")
TRADER_DIR, TEMP_DIR = _get_trader_dir(".vntrader")
def get_file_path(filename: str):
"""
Get path for temp file with filename.
"""
return TEMP_PATH.joinpath(filename)
return TEMP_DIR.joinpath(filename)
def get_folder_path(folder_name: str):
"""
Get path for temp folder with folder name.
"""
folder_path = TEMP_PATH.joinpath(folder_name)
folder_path = TEMP_DIR.joinpath(folder_name)
if not folder_path.exists():
folder_path.mkdir()
return folder_path
@ -395,5 +395,3 @@ def virtual(func: "callable"):
that can be (re)implemented by subclasses.
"""
return func