MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / load_config

Function load_config

aura/config.py:211–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

209
210
211def load_config():
212 global SEMANTIC_RULES, CFG, CFG_PATH
213
214 CFG_PATH = str(find_configuration())
215 CFG = parse_config(CFG_PATH, DEFAULT_CFG_PATH)
216
217 if "AURA_SIGNATURES" in os.environ:
218 semantic_sig_pth = os.environ["AURA_SIGNATURES"]
219 else:
220 semantic_sig_pth = CFG["aura"]["semantic-rules"]
221
222 SEMANTIC_RULES = parse_config(semantic_sig_pth, DEFAULT_SIGNATURE_PATH)
223
224 if "AURA_LOG_LEVEL" in os.environ:
225 log_level = logging.getLevelName(os.getenv("AURA_LOG_LEVEL").upper())
226 else:
227 log_level = logging.getLevelName(
228 CFG["aura"].get("log-level", "warning").upper()
229 )
230
231 configure_logger(log_level)
232
233 if not sys.warnoptions:
234 w_filter = CFG["aura"].get("warnings", "default")
235 warnings.simplefilter(w_filter)
236 os.environ["PYTHONWARNINGS"] = w_filter
237
238 rss = CFG["aura"].get("rlimit-memory")
239 if rss:
240 resource.setrlimit(resource.RLIMIT_RSS, (rss, rss))
241
242 fsize = CFG["aura"].get("rlimit-fsize")
243 if fsize:
244 resource.setrlimit(resource.RLIMIT_FSIZE, (fsize, fsize))
245
246 rec_limit = os.environ.get("AURA_RECURSION_LIMIT") or CFG["aura"].get("python-recursion-limit")
247
248 if rec_limit:
249 sys.setrecursionlimit(int(rec_limit))
250
251
252def get_pypi_stats_path(exc=True) -> Path:

Callers 1

config.pyFile · 0.85

Calls 4

find_configurationFunction · 0.85
parse_configFunction · 0.85
configure_loggerFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected