[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [sbws/master] Replace _read_config.. by _extend_config...
commit 9435f6824d9a5341f845a058107eff0e6189ce54
Author: juga0 <juga@xxxxxxxxxx>
Date: Mon Jul 23 21:37:04 2018 +0000
Replace _read_config.. by _extend_config...
---
sbws/util/config.py | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/sbws/util/config.py b/sbws/util/config.py
index 3171ad2..61a0e61 100644
--- a/sbws/util/config.py
+++ b/sbws/util/config.py
@@ -31,24 +31,18 @@ def _create_user_config_file(fname):
shutil.copyfile(MINIMUM_USER_CONFIG_PATH, fname)
-def _read_config_file(conf, fname):
- assert os.path.isfile(fname)
+def _extend_config(conf, fname):
+ """Extend ConfigParser from file configuration."""
log.debug('Reading config file %s', fname)
with open(fname, 'rt') as fd:
conf.read_file(fd, source=fname)
return conf
-def _extend_config(conf, fpath):
- """Extend ConfigParser from file configuration."""
- conf = _read_config_file(conf, fpath)
- return conf
-
-
def _get_default_config():
"""Return ConfigParser with default configuration."""
conf = ConfigParser(interpolation=ExtendedInterpolation())
- return _read_config_file(conf, DEFAULT_CONFIG_PATH)
+ return _extend_config(conf, DEFAULT_CONFIG_PATH)
def _get_user_config(args, conf=None):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits