From: Ian Jackson Date: Sun, 23 Apr 2017 23:50:13 +0000 (+0100) Subject: move cfg_get_raw into hippotatlib X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/commitdiff_plain/fa63bd9399a07c4b26affb3fc214291331d120b4 move cfg_get_raw into hippotatlib Signed-off-by: Ian Jackson --- diff --git a/hippotat b/hippotat index 379a184..f9395f2 100755 --- a/hippotat +++ b/hippotat @@ -254,9 +254,6 @@ def process_cfg(_opts, putative_servers, putative_clients): c.max_queue_time = srch(cfg.getint, 'max_queue_time') c.vroutes = srch(cfg.get, 'vroutes') - def cfg_get_raw(*args, **kwargs): - return cfg.get(*args, raw=True, **kwargs) - try: c.ifname = srch(cfg_get_raw, 'ifname_client') except NoOptionError: pass diff --git a/hippotatlib/__init__.py b/hippotatlib/__init__.py index a4e7b69..7781c1f 100644 --- a/hippotatlib/__init__.py +++ b/hippotatlib/__init__.py @@ -484,6 +484,10 @@ def cfg_search_section(key,sections): return section raise NoOptionError(key, repr(sections)) +def cfg_get_raw(*args, **kwargs): + # for passing to cfg_search + return cfg.get(*args, raw=True, **kwargs) + def cfg_search(getter,key,sections): section = cfg_search_section(key,sections) return getter(section, key)