mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-12 20:31:18 +00:00
* add log path * add test to check if log file is in correct dir * env path * black * mypy fix * linting * add make_paths and change references * terminal change * change constants to paths * change names * black * mypy * mypy * pylint else * add make paths * remove custom user dir name Co-authored-by: Chavithra <chavithra@gmail.com>
29 lines
690 B
Python
29 lines
690 B
Python
# IMPORTATION STANDARD
|
|
import os
|
|
from openbb_terminal.core.config.paths import (
|
|
SETTINGS_DIRECTORY,
|
|
USER_DATA_DIRECTORY,
|
|
USER_ENV_FILE,
|
|
ENV_FILE_REPOSITORY,
|
|
)
|
|
|
|
|
|
def create_paths():
|
|
"""
|
|
Creates dirs/files for user data and .env files outside the
|
|
terminal if they don't exist
|
|
"""
|
|
if not os.path.exists(SETTINGS_DIRECTORY):
|
|
os.mkdir(SETTINGS_DIRECTORY)
|
|
|
|
if not USER_ENV_FILE.is_file():
|
|
with open(str(USER_ENV_FILE), "w"):
|
|
pass
|
|
|
|
if not ENV_FILE_REPOSITORY.is_file():
|
|
with open(str(ENV_FILE_REPOSITORY), "w"):
|
|
pass
|
|
|
|
if not os.path.exists(USER_DATA_DIRECTORY):
|
|
os.mkdir(USER_DATA_DIRECTORY)
|