add global option "support_dirs"
Stores a list of support directories separated by ";", where
support- and resource-files are stored e.g. ".ctb" or ".stb"
files.
-# Copyright (c) 2011-2021, Manfred Moitzi
+# Copyright (c) 2011-2022, Manfred Moitzi
# License: MIT License
-from typing import TextIO, List, Union, Tuple
+from typing import TextIO, List, Union, Tuple, Sequence
import os
import sys
from pathlib import Path
@@ -33,6 +33,7 @@ CONFIG_DIRECTORY = ".config"
ODAFC_ADDON = "odafc-addon"
OPENSCAD_ADDON = "openscad-addon"
DRAWING_ADDON = "drawing-addon"
+DIR_SEPARATOR = ";"
def xdg_path(xdg_var: str, directory: str) -> Path:
@@ -64,6 +65,7 @@ def default_config() -> ConfigParser:
"DEFAULT_DIMENSION_TEXT_STYLE": "OpenSansCondensed-Light",
"TEST_FILES": "",
"FONT_CACHE_DIRECTORY": "",
+ "SUPPORT_DIRS": "",
"LOAD_PROXY_GRAPHICS": "true",
"STORE_PROXY_GRAPHICS": "true",
"LOG_UNPROCESSED_TAGS": "false",
@@ -249,6 +251,14 @@ class Options:
else:
raise ValueError(f'directory "{dirname}" does not exist')
+ @property
+ def support_dirs(self) -> Sequence[str]:
+ return self.get(CORE, "SUPPORT_DIRS", "").split(DIR_SEPARATOR)
+
+ @support_dirs.setter
+ def support_dirs(self, support_dirs: Sequence[str]) -> None:
+ self.set(CORE, "SUPPORT_DIRS", DIR_SEPARATOR.join(support_dirs))
+
@property
def test_files(self) -> str:
return os.path.expanduser(self.get(CORE, "TEST_FILES"))
