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

Method get_opt

tools/python/maps_generator/generator/settings.py:59–64  ·  view source on GitHub ↗
(self, s: AnyStr, v: AnyStr, default: Any = None)

Source from the content-addressed store, hash-verified

57 self.config.read([get_config_path(default_settings_path)])
58
59 def get_opt(self, s: AnyStr, v: AnyStr, default: Any = None):
60 val = CfgReader._get_env_val(s, v)
61 if val is not None:
62 return val
63
64 return self.config.get(s, v) if self.config.has_option(s, v) else default
65
66 def get_opt_path(self, s: AnyStr, v: AnyStr, default: AnyStr = ""):
67 return os.path.expanduser(self.get_opt(s, v, default))

Callers 3

initFunction · 0.95
get_opt_pathMethod · 0.95
initFunction · 0.95

Calls 2

_get_env_valMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected