MCPcopy Create free account
hub / github.com/comaps/comaps / init

Function init

tools/python/airmaps/instruments/settings.py:33–62  ·  view source on GitHub ↗
(default_settings_path: AnyStr)

Source from the content-addressed store, hash-verified

31
32
33def init(default_settings_path: AnyStr):
34 settings.init(default_settings_path)
35
36 # Try to read a config and to overload default settings
37 cfg = settings.CfgReader(default_settings_path)
38
39 # Storage section
40 global WD_HOST
41 global WD_LOGIN
42 global WD_PASSWORD
43
44 WD_HOST = cfg.get_opt("Storage", "WD_HOST", WD_HOST)
45 WD_LOGIN = cfg.get_opt("Storage", "WD_LOGIN", WD_LOGIN)
46 WD_PASSWORD = cfg.get_opt("Storage", "WD_PASSWORD", WD_PASSWORD)
47
48 # Common section
49 global EMAILS
50 emails = cfg.get_opt("Common", "EMAILS", "")
51 EMAILS = get_airmaps_emails(emails)
52
53 # Import all contains from maps_generator.generator.settings.
54 thismodule = sys.modules[__name__]
55 for name in dir(settings):
56 if not name.startswith("_") and name.isupper():
57 value = getattr(settings, name)
58 setattr(thismodule, name, value)
59
60 global STORAGE_PREFIX
61 if settings.DEBUG:
62 STORAGE_PREFIX = "/tests"

Callers

nothing calls this directly

Calls 3

get_optMethod · 0.95
get_airmaps_emailsFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected