Пример #1
0
 def main(self, path):
     self.path = path
     with open(self.path, 'r') as source:
         self.source = source.read()
         self.tree = ast.parse(self.source)
         self.cfg = ast_to_cfg(self.tree)
     return self.run()
Пример #2
0
 def __init__(self, path):
     super().__init__()
     self.path = path
     with open(self.path, 'r') as source:
         self.source = source.read()
         self.tree = ast.parse(self.source)
         self.cfg = ast_to_cfg(self.tree)
Пример #3
0
 def __init__(self, path):
     super().__init__()
     self.path = path
     self.maxDiff = None  # to allow large diff displays in error messages
     with open(self.path, 'r', encoding="utf-8") as source:
         self.source = source.read()
         self.tree = ast.parse(self.source)
         self.cfg = ast_to_cfg(self.tree)