Compare commits
No commits in common. "93ca059fc0950d361bf2bd85e468fa8200236e90" and "4e3327709e73fab585b17004c19275c76e082f54" have entirely different histories.
93ca059fc0
...
4e3327709e
3 changed files with 4 additions and 10 deletions
|
|
@ -158,10 +158,6 @@ def import_toml(path: Path, file: str, copy_file: bool=True) -> None:
|
||||||
copy_file: bool, optional
|
copy_file: bool, optional
|
||||||
Whether the toml-files will be copied into the library. Default is True.
|
Whether the toml-files will be copied into the library. Default is True.
|
||||||
"""
|
"""
|
||||||
if not os.path.exists(path):
|
|
||||||
raise FileNotFoundError(f"Corrlib path {path} does not exist.")
|
|
||||||
if not os.path.exists(file):
|
|
||||||
raise FileNotFoundError(f".toml-file {file} does not exist.")
|
|
||||||
print("Import project as decribed in " + file)
|
print("Import project as decribed in " + file)
|
||||||
with open(file, 'rb') as fp:
|
with open(file, 'rb') as fp:
|
||||||
toml_dict = toml.load(fp)
|
toml_dict = toml.load(fp)
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ def set_config(path: Path, section: str, option: str, value: Any) -> None:
|
||||||
value: Any
|
value: Any
|
||||||
The value we set the option to.
|
The value we set the option to.
|
||||||
"""
|
"""
|
||||||
config_path = path / CONFIG_FILENAME
|
config_path = os.path.join(path, CONFIG_FILENAME)
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
|
@ -115,9 +115,7 @@ def get_db_file(path: Path) -> Path:
|
||||||
db_file: str
|
db_file: str
|
||||||
The file holding the database.
|
The file holding the database.
|
||||||
"""
|
"""
|
||||||
if not os.path.exists(path):
|
config_path = os.path.join(path, CONFIG_FILENAME)
|
||||||
raise FileNotFoundError(f"Corrlib path {path} does not exist.")
|
|
||||||
config_path = path / CONFIG_FILENAME
|
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
|
@ -142,7 +140,7 @@ def cache_enabled(path: Path) -> bool:
|
||||||
cached_bool: bool
|
cached_bool: bool
|
||||||
Whether the given library is cached.
|
Whether the given library is cached.
|
||||||
"""
|
"""
|
||||||
config_path = path / CONFIG_FILENAME
|
config_path = os.path.join(path, CONFIG_FILENAME)
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ def get_tracker(path: Path) -> str:
|
||||||
tracker: str
|
tracker: str
|
||||||
The tracker used in the dataset.
|
The tracker used in the dataset.
|
||||||
"""
|
"""
|
||||||
config_path = path / CONFIG_FILENAME
|
config_path = os.path.join(path, CONFIG_FILENAME)
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
if os.path.exists(config_path):
|
if os.path.exists(config_path):
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue