Files
basegame-vcko/python3-vckonline/lib/python3.8/site-packages/pop_config/config/os/init.py
2020-11-03 18:30:14 -08:00

29 lines
884 B
Python

"""
The os sub is used to gather configuration options from the OS facility
to send configuration options into applications.
"""
# Import python libs
import os
def gather(hub, raw):
"""
Collect the keys that need to be found and pass them to the
os specific loaded plugin
"""
ret = {}
for imp in raw:
for sec in hub.config.CONFIG_SECTIONS:
if sec not in raw[imp]:
continue
for key in raw[imp][sec]:
osvar = raw[imp][sec][key].get("os", None)
if osvar is not None:
val = hub.config.os.system.collect(osvar)
if val is not None:
src = raw[imp][sec][key].get("source", imp)
if src not in ret:
ret[src] = {}
ret[src][key] = val
return ret