MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / get_tree

Method get_tree

code2flow/python.py:149–162  ·  view source on GitHub ↗

Get the entire AST for this file :param filename str: :rtype: ast

(filename, _)

Source from the content-addressed store, hash-verified

147
148 @staticmethod
149 def get_tree(filename, _):
150 """
151 Get the entire AST for this file
152
153 :param filename str:
154 :rtype: ast
155 """
156 try:
157 with open(filename) as f:
158 raw = f.read()
159 except ValueError:
160 with open(filename, encoding='UTF-8') as f:
161 raw = f.read()
162 return ast.parse(raw)
163
164 @staticmethod
165 def separate_namespaces(tree):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected