MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / parse_file

Method parse_file

tools/ng/config.py:78–94  ·  view source on GitHub ↗

Parse configuration file. Args: filepath: Path to rtconfig.h Returns: Dictionary of configuration options

(self, filepath: str)

Source from the content-addressed store, hash-verified

76 self.conditions: List[str] = []
77
78 def parse_file(self, filepath: str) -> Dict[str, ConfigOption]:
79 """
80 Parse configuration file.
81
82 Args:
83 filepath: Path to rtconfig.h
84
85 Returns:
86 Dictionary of configuration options
87 """
88 if not os.path.exists(filepath):
89 raise FileNotFoundError(f"Configuration file not found: {filepath}")
90
91 with open(filepath, 'r', encoding='utf-8') as f:
92 content = f.read()
93
94 return self.parse_content(content)
95
96 def parse_content(self, content: str) -> Dict[str, ConfigOption]:
97 """

Callers 1

load_from_fileMethod · 0.80

Calls 3

parse_contentMethod · 0.95
openFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected