config parsing works with persistance
This commit is contained in:
@@ -18,4 +18,5 @@ ctf = "ctf.main:main"
|
|||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = ["src/ctf"]
|
packages = ["src/ctf"]
|
||||||
|
|
||||||
|
[tool.pyright]
|
||||||
extraPaths = ["src"]
|
extraPaths = ["src"]
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ from pathlib import Path
|
|||||||
from platformdirs import user_config_dir
|
from platformdirs import user_config_dir
|
||||||
from platformdirs import user_data_dir
|
from platformdirs import user_data_dir
|
||||||
# Parse config file
|
# Parse config file
|
||||||
# CONFIG_DIR = Path(user_config_dir("ctf")) #config directory is $XDG_CONFIG_HOME/ctf/
|
|
||||||
CONFIG_DIR = Path("/home/venus/code/ctf/")
|
|
||||||
CONFIG_FILE = CONFIG_DIR / "config.toml"
|
|
||||||
|
|
||||||
|
|
||||||
def load_config():
|
def load_config():
|
||||||
|
# CONFIG_DIR = Path(user_config_dir("ctf")) #config directory is $XDG_CONFIG_HOME/ctf/
|
||||||
|
CONFIG_DIR = Path("/home/venus/code/ctf/")
|
||||||
|
CONFIG_FILE = CONFIG_DIR / "config.toml"
|
||||||
if not CONFIG_FILE.exists():
|
if not CONFIG_FILE.exists():
|
||||||
print("nothing in config, relying on default opts")
|
print("nothing in config, relying on default opts")
|
||||||
#this is where to declare default vals if not otherwise specified
|
#this is where to declare default vals if not otherwise specified
|
||||||
|
|||||||
Reference in New Issue
Block a user