MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / initialize_globals

Function initialize_globals

codewiki/src/fe/visualise_docs.py:34–48  ·  view source on GitHub ↗

Initialize global variables from environment or command line args if not already set.

()

Source from the content-addressed store, hash-verified

32MODULE_TREE = None
33
34def initialize_globals():
35 """Initialize global variables from environment or command line args if not already set."""
36 global DOCS_FOLDER, MODULE_TREE
37
38 if DOCS_FOLDER is None:
39 # Try to get from environment variable or use a default
40 import os
41 docs_folder_path = os.environ.get('DOCS_FOLDER')
42 if docs_folder_path and Path(docs_folder_path).exists():
43 DOCS_FOLDER = docs_folder_path
44 MODULE_TREE = load_module_tree(Path(docs_folder_path))
45 else:
46 # If no environment variable, we need to handle this gracefully
47 # The FastAPI endpoints will need to check if DOCS_FOLDER is None
48 pass
49
50# Markdown parser
51md = MarkdownIt()

Callers 2

indexFunction · 0.85
serve_docFunction · 0.85

Calls 2

load_module_treeFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected