X-Git-Url: https://git.novaco.in/?p=electrum-nvc.git;a=blobdiff_plain;f=lib%2Fsimple_config.py;h=86df56606912e91aa203e15311aeec582ebbd1ee;hp=b70e5c96e85ecd2c47e5e32a92f91970265be97f;hb=ad3640d7a4bc4627694df3c277cd83972256c543;hpb=221fa5848f0348bd02586c86a50feb9916c7cea2 diff --git a/lib/simple_config.py b/lib/simple_config.py index b70e5c9..86df566 100644 --- a/lib/simple_config.py +++ b/lib/simple_config.py @@ -135,10 +135,10 @@ class SimpleConfig(object): import stat os.chmod(path, stat.S_IREAD | stat.S_IWRITE) -def read_system_config(): +def read_system_config(path=SYSTEM_CONFIG_PATH): """Parse and return the system config settings in /etc/electrum.conf.""" result = {} - if os.path.exists(SYSTEM_CONFIG_PATH): + if os.path.exists(path): try: import ConfigParser except ImportError: @@ -146,13 +146,13 @@ def read_system_config(): return p = ConfigParser.ConfigParser() - p.read(SYSTEM_CONFIG_PATH) - result = {} try: + p.read(path) for k, v in p.items('client'): result[k] = v - except ConfigParser.NoSectionError: + except (ConfigParser.NoSectionError, ConfigParser.MissingSectionHeaderError): pass + return result def read_user_config(path):