2020-06-04 19:16:51 +02:00
|
|
|
import logging
|
2020-06-03 19:41:30 +02:00
|
|
|
from pathlib import Path
|
2021-02-16 19:28:30 +01:00
|
|
|
import os
|
2020-06-03 19:41:30 +02:00
|
|
|
|
2020-06-06 02:00:16 +02:00
|
|
|
log = logging.getLogger("tuxbot.core.data_manager")
|
2020-06-04 19:16:51 +02:00
|
|
|
|
2021-02-16 19:28:30 +01:00
|
|
|
core_path = Path(os.getcwd())
|
2020-06-03 19:41:30 +02:00
|
|
|
|
2021-02-16 19:28:30 +01:00
|
|
|
data_path = core_path / "data"
|
|
|
|
config_path = data_path / "settings"
|
|
|
|
config_file = config_path / "config.yaml"
|
2020-06-04 00:46:53 +02:00
|
|
|
|
|
|
|
|
2021-02-16 19:28:30 +01:00
|
|
|
def logs_data_path() -> Path:
|
2020-11-09 01:18:55 +01:00
|
|
|
"""Return Path for Logs.
|
2020-06-05 00:29:14 +02:00
|
|
|
|
|
|
|
Returns
|
|
|
|
-------
|
|
|
|
Path
|
2020-11-09 01:18:55 +01:00
|
|
|
Generated path for Logs files.
|
2020-06-05 00:29:14 +02:00
|
|
|
"""
|
2021-02-16 19:28:30 +01:00
|
|
|
return data_path / "logs"
|
2020-10-19 21:44:29 +02:00
|
|
|
|
|
|
|
|
2021-02-16 19:28:30 +01:00
|
|
|
def cogs_data_path(cog_name: str = "") -> Path:
|
2020-10-19 21:44:29 +02:00
|
|
|
"""Return Path for cogs.
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
----------
|
|
|
|
cog_name:str
|
|
|
|
|
|
|
|
Returns
|
|
|
|
-------
|
|
|
|
Path
|
|
|
|
Generated path for cogs configs.
|
|
|
|
"""
|
2021-02-16 19:28:30 +01:00
|
|
|
return data_path / "settings" / "cogs" / cog_name
|