allow example config to be in CWD or CWD/pyfpdb on posix
This commit is contained in:
parent
e23200e13d
commit
58f656f374
|
@ -104,6 +104,11 @@ def get_config(file_name, fallback = True):
|
|||
# the config directory for us so there's no need to check it
|
||||
# again
|
||||
example_path = '/usr/share/python-fpdb/' + file_name + '.example'
|
||||
if not os.path.exists(example_path):
|
||||
if os.path.exists(file_name + '.example'):
|
||||
example_path = file_name + '.example'
|
||||
else:
|
||||
example_path = "pyfpdb/" + file_name + '.example'
|
||||
if not config_found and fallback:
|
||||
try:
|
||||
shutil.copyfile(example_path, config_path)
|
||||
|
@ -735,7 +740,7 @@ class Config:
|
|||
#sys.exc_info = (<class 'xml.parsers.expat.ExpatError'>, ExpatError('not well-formed (invalid token): line 511,
|
||||
# column 4',), <traceback object at 0x024503A0>)
|
||||
|
||||
if not self.example_copy and example_file is not None:
|
||||
if (not self.example_copy) and (example_file is not None):
|
||||
# reads example file and adds missing elements into current config
|
||||
added = self.add_missing_elements(doc, example_file)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user