MCPcopy Create free account
hub / github.com/CheckPointSW/Karta / functionsToFile

Function functionsToFile

src/config/utils.py:151–161  ·  view source on GitHub ↗

Store all of the file's functions into a state file. Args: file_name (str): file name of a compiled source file contexts (list): list of FunctionContext instances for all of the functions in the file

(file_name, contexts)

Source from the content-addressed store, hash-verified

149 return library_name + "_" + library_version + ("_windows" if isWindows() else "") + ".json"
150
151def functionsToFile(file_name, contexts):
152 """Store all of the file's functions into a state file.
153
154 Args:
155 file_name (str): file name of a compiled source file
156 contexts (list): list of FunctionContext instances for all of the functions in the file
157 """
158 # Temporary JSON (later will be merged to a single JSON)
159 fd = open(file_name + STATE_FILE_SUFFIX, "w")
160 json.dump([c.serialize() for c in contexts], fd)
161 fd.close()
162
163def parseFileStats(file_name, functions_config):
164 """Parse the file metadata from the given file.

Callers 1

analyzeFileFunction · 0.85

Calls 1

serializeMethod · 0.80

Tested by

no test coverage detected