(self, configfile=None, basedir=None)
| 196 | class Settings(object): |
| 197 | |
| 198 | def __init__(self, configfile=None, basedir=None): |
| 199 | self._logger = logging.getLogger(__name__) |
| 200 | |
| 201 | self.settings_dir = None |
| 202 | |
| 203 | self._config = None |
| 204 | self._dirty = False |
| 205 | self._saveLock = threading.Lock() |
| 206 | |
| 207 | if configfile is not None: |
| 208 | self._configfile = configfile |
| 209 | |
| 210 | else: |
| 211 | if basedir: |
| 212 | settings_dir = basedir |
| 213 | else: |
| 214 | settings_dir = os.path.realpath(os.path.dirname(__file__)+'/../../local') |
| 215 | |
| 216 | self._configfile = os.path.join(settings_dir, "config.yaml") |
| 217 | |
| 218 | self._init_settings_dir(basedir) |
| 219 | |
| 220 | self._factoryConfigFile = os.path.join(os.path.dirname(self._configfile), "config.factory") |
| 221 | |
| 222 | self.load() |
| 223 | |
| 224 | def _init_settings_dir(self, basedir): |
| 225 | if basedir is not None: |
nothing calls this directly
no test coverage detected