Properties


classes

Get a recursive list of all classes in the directory and its subdirectories.

def classes(self) -> list[TClass]:
    ...

files

Get a recursive list of all files in the directory and its subdirectories.

def files(self) -> list[TFile]:
    ...

functions

Get a recursive list of all functions in the directory and its subdirectories.

def functions(self) -> list[TFunction]:
    ...

global_vars

Get a recursive list of all global variables in the directory and its subdirectories.

def global_vars(self) -> list[TGlobalVar]:
    ...

import_statements

Get a recursive list of all import statements in the directory and its subdirectories.

def import_statements(self) -> list[TImportStatement]:
    ...

name

Get the base name of the directory’s path.

Extracts the final component of the directory path. For example, for a path ‘/home/user/project’, returns ‘project’.

Returns: str: The directory’s base name.

def name(self) -> str:
    ...

subdirectories

Get a recursive list of all subdirectories in the directory and its subdirectories.

def subdirectories(self) -> list[Self]:
    ...

symbols

Get a recursive list of all symbols in the directory and its subdirectories.

def symbols(self) -> list[TSymbol]:
    ...

Methods


add_file

Add a file to the directory.

def add_file(self, file: TFile) -> None:
    ...

add_subdirectory

Add a subdirectory to the directory.

def add_subdirectory(self, subdirectory: Self) -> None:
    ...

get_class

Get a class by name in the directory and its subdirectories.

def get_class(self, name: str) -> TClass | None:
    ...

get_file

Get a file by its name relative to the directory.

def get_file(self, filename: str) -> TFile | None:
    ...

get_function

Get a function by name in the directory and its subdirectories.

def get_function(self, name: str) -> TFunction | None:
    ...

get_global_var

Get a global variable by name in the directory and its subdirectories.

def get_global_var(self, name: str) -> TGlobalVar | None:
    ...

get_import_statement

Get an import statement by name in the directory and its subdirectories.

def get_import_statement(self, name: str) -> TImportStatement | None:
    ...

get_subdirectory

Get a subdirectory by its path relative to the directory.

def get_subdirectory(self, subdirectory_name: str) -> Self | None:
    ...

get_symbol

Get a symbol by name in the directory and its subdirectories.

def get_symbol(self, name: str) -> TSymbol | None:
    ...

remove

Remove the directory and all its files and subdirectories.

def remove(self):
    ...

remove_file

Remove a file from the directory.

def remove_file(self, file: TFile) -> None:
    ...

remove_file_by_path

Remove a file from the directory by its path.

def remove_file_by_path(self, file_path: str) -> None:
    ...

remove_subdirectory

Remove a subdirectory from the directory.

def remove_subdirectory(self, subdirectory: Self) -> None:
    ...

remove_subdirectory_by_path

Remove a subdirectory from the directory by its path.

def remove_subdirectory_by_path(self, subdirectory_path: str) -> None:
    ...

rename

Rename the directory.

def rename(self, new_name: str) -> None:
    ...

update_filepath

Update the filepath of the directory.

def update_filepath(self, new_filepath: str) -> None:
    ...

Was this page helpful?