Method: pylint.pyreverse.inspector.project_from_files
Calls: 41, Exceptions: 0, Paths: 4Back
Path 1: 27 calls (0.66)
['/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/pyreverse/../data'] (14) ['data'] (9) ['/Users/andrehora/Documents/git/projects-pat...
get_project.
'No Name' (12) 'data' (7) '' (4) 'colorized' (4)
('CVS',) (27)
Project (27)
1def project_from_files(
2 files: list[str],
3 func_wrapper: _WrapperFuncT = _astroid_wrapper,
4 project_name: str = "no name",
5 black_list: tuple[str, ...] = constants.DEFAULT_IGNORE_LIST,
6) -> Project:
7 """Return a Project from a list of files or modules."""
8 # build the project representation
9 astroid_manager = astroid.MANAGER
10 project = Project(project_name)
11 for something in files:
12 if not os.path.exists(something):
13 fpath = astroid.modutils.file_from_modpath(something.split("."))
14 elif os.path.isdir(something):
15 fpath = os.path.join(something, "__init__.py")
16 else:
17 fpath = something
18 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
19 if ast is None:
20 continue
21 project.path = project.path or ast.file
22 project.add_module(ast)
23 base_name = ast.name
24 # recurse in package except if __init__ was explicitly given
25 if ast.package and something.find("__init__") == -1:
26 # recurse on others packages / modules if this is a package
27 for fpath in astroid.modutils.get_module_files(
28 os.path.dirname(ast.file), black_list
29 ):
30 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
31 if ast is None or ast.name == base_name:
32 continue
33 project.add_module(ast)
34 return project
Path 2: 11 calls (0.27)
['/Users/andrehora/Documents/git/projects-pathspotter/pylint/tests/pyreverse/functional/class_diagrams/annotations/attributes_annotation.py'] (3) ['/U...
_astroid_wrapper def (11)
'' (11)
('CVS',) (11)
Project (11)
1def project_from_files(
2 files: list[str],
3 func_wrapper: _WrapperFuncT = _astroid_wrapper,
4 project_name: str = "no name",
5 black_list: tuple[str, ...] = constants.DEFAULT_IGNORE_LIST,
6) -> Project:
7 """Return a Project from a list of files or modules."""
8 # build the project representation
9 astroid_manager = astroid.MANAGER
10 project = Project(project_name)
11 for something in files:
12 if not os.path.exists(something):
13 fpath = astroid.modutils.file_from_modpath(something.split("."))
14 elif os.path.isdir(something):
15 fpath = os.path.join(something, "__init__.py")
16 else:
17 fpath = something
18 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
19 if ast is None:
20 continue
21 project.path = project.path or ast.file
22 project.add_module(ast)
23 base_name = ast.name
24 # recurse in package except if __init__ was explicitly given
25 if ast.package and something.find("__init__") == -1:
26 # recurse on others packages / modules if this is a package
27 for fpath in astroid.modutils.get_module_files(
28 os.path.dirname(ast.file), black_list
29 ):
30 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
31 if ast is None or ast.name == base_name:
32 continue
33 project.add_module(ast)
34 return project
Path 3: 2 calls (0.05)
['data.clientmodule_test'] (1) ['data.property_pattern'] (1)
get_project.
'No Name' (2)
('CVS',) (2)
Project (2)
1def project_from_files(
2 files: list[str],
3 func_wrapper: _WrapperFuncT = _astroid_wrapper,
4 project_name: str = "no name",
5 black_list: tuple[str, ...] = constants.DEFAULT_IGNORE_LIST,
6) -> Project:
7 """Return a Project from a list of files or modules."""
8 # build the project representation
9 astroid_manager = astroid.MANAGER
10 project = Project(project_name)
11 for something in files:
12 if not os.path.exists(something):
13 fpath = astroid.modutils.file_from_modpath(something.split("."))
14 elif os.path.isdir(something):
15 fpath = os.path.join(something, "__init__.py")
16 else:
17 fpath = something
18 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
19 if ast is None:
20 continue
21 project.path = project.path or ast.file
22 project.add_module(ast)
23 base_name = ast.name
24 # recurse in package except if __init__ was explicitly given
25 if ast.package and something.find("__init__") == -1:
26 # recurse on others packages / modules if this is a package
27 for fpath in astroid.modutils.get_module_files(
28 os.path.dirname(ast.file), black_list
29 ):
30 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
31 if ast is None or ast.name == base_name:
32 continue
33 project.add_module(ast)
34 return project
Path 4: 1 calls (0.02)
['regrtest_data/dataclasses_pyreverse'] (1)
get_project.
'No Name' (1)
('CVS',) (1)
Project (1)
1def project_from_files(
2 files: list[str],
3 func_wrapper: _WrapperFuncT = _astroid_wrapper,
4 project_name: str = "no name",
5 black_list: tuple[str, ...] = constants.DEFAULT_IGNORE_LIST,
6) -> Project:
7 """Return a Project from a list of files or modules."""
8 # build the project representation
9 astroid_manager = astroid.MANAGER
10 project = Project(project_name)
11 for something in files:
12 if not os.path.exists(something):
13 fpath = astroid.modutils.file_from_modpath(something.split("."))
14 elif os.path.isdir(something):
15 fpath = os.path.join(something, "__init__.py")
16 else:
17 fpath = something
18 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
19 if ast is None:
20 continue
21 project.path = project.path or ast.file
22 project.add_module(ast)
23 base_name = ast.name
24 # recurse in package except if __init__ was explicitly given
25 if ast.package and something.find("__init__") == -1:
26 # recurse on others packages / modules if this is a package
27 for fpath in astroid.modutils.get_module_files(
28 os.path.dirname(ast.file), black_list
29 ):
30 ast = func_wrapper(astroid_manager.ast_from_file, fpath)
31 if ast is None or ast.name == base_name:
32 continue
33 project.add_module(ast)
34 return project