MCPcopy Create free account
hub / github.com/ddnet/ddnet / main

Function main

scripts/extract_identifiers.py:155–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153
154
155def main():
156 p = argparse.ArgumentParser(description="Extracts identifier data from a Teeworlds source file and its header, outputting the data as CSV to stdout")
157 p.add_argument("file", metavar="FILE", nargs="+", help="Source file to analyze")
158 p.add_argument("--break-on", help="Break on a specific variable name, useful to debug issues with the script")
159 args = p.parse_args()
160
161 extra_args = []
162 if "CXXFLAGS" in os.environ:
163 extra_args = os.environ["CXXFLAGS"].split()
164
165 out = csv.DictWriter(sys.stdout, "file line column kind path qualifiers type name".split())
166 out.writeheader()
167 files = args.file
168 if len(files) > 1:
169 files = tqdm(files, leave=False)
170 error = False
171 for file in files:
172 try:
173 process_source_file(out, file, extra_args, args.break_on)
174 except ParseError:
175 error = True
176 return int(error)
177
178
179if __name__ == "__main__":

Callers 1

Calls 2

tqdmFunction · 0.85
process_source_fileFunction · 0.85

Tested by

no test coverage detected