MCPcopy
hub / github.com/Gallopsled/pwntools / initialize

Function initialize

pwnlib/config.py:53–71  ·  view source on GitHub ↗

Read the configuration files.

()

Source from the content-addressed store, hash-verified

51 registered_configs[section] = function
52
53def initialize():
54 """Read the configuration files."""
55 from pwnlib.log import getLogger
56 log = getLogger(__name__)
57
58 xdg_config_home = os.environ.get('XDG_CONFIG_HOME',
59 os.path.expanduser("~/.config"))
60
61 c = configparser.ConfigParser()
62 c.read(['/etc/pwn.conf',
63 os.path.join(xdg_config_home, 'pwn.conf'),
64 os.path.expanduser('~/.pwn.conf')])
65
66 for section in c.sections():
67 if section not in registered_configs:
68 log.warn("Unknown configuration section %r", section)
69 continue
70 settings = dict(c.items(section))
71 registered_configs[section](settings)

Callers

nothing calls this directly

Calls 7

getLoggerFunction · 0.90
expanduserMethod · 0.80
sectionsMethod · 0.80
warnMethod · 0.80
itemsMethod · 0.80
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected