Walk an AST collecting import/include statements.
Definition at line 18 of file apydep.py.
◆ __init__()
def apydep.DependencyFinder.__init__ |
( |
|
self | ) |
|
◆ visit_Call()
def apydep.DependencyFinder.visit_Call |
( |
|
self, |
|
|
|
node |
|
) |
| |
"include(XYZ/ABC.py)
Definition at line 34 of file apydep.py.
34 def visit_Call(self, node):
35 """"include(XYZ/ABC.py)"""
36 if isinstance(node.func, ast.Name)
and node.func.id==
'include' and node.args:
37 if isinstance(node.args[0], ast.Str):
38 self.includes.
add(node.args[0].s.split(
'/',1)[0])
◆ visit_Import()
def apydep.DependencyFinder.visit_Import |
( |
|
self, |
|
|
|
node |
|
) |
| |
import XYZ
Definition at line 25 of file apydep.py.
25 def visit_Import(self, node):
27 self.imports.
update(alias.name.split(
'.',1)[0]
for alias
in node.names)
◆ visit_ImportFrom()
def apydep.DependencyFinder.visit_ImportFrom |
( |
|
self, |
|
|
|
node |
|
) |
| |
from XYZ import ABC
Definition at line 29 of file apydep.py.
29 def visit_ImportFrom(self, node):
30 """from XYZ import ABC"""
32 self.imports.
add(node.module.split(
'.',1)[0])
◆ imports
apydep.DependencyFinder.imports |
◆ includes
apydep.DependencyFinder.includes |
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.