PCART  v1.4
Automated Repair of Python API Parameter Compatibility Issues
Public Member Functions | List of all members
Path Class Reference

The Path class definition 路径定义类 More...

Public Member Functions

def __init__ (self, mode)
 Initialize the Path object with a traversal mode 使用遍历模式初始化Path对象 More...
 
def clc (self)
 Clear previously collected path data for reuse 清空之前收集的路径数据以便复用 More...
 
def getPath (self, rootDir)
 Traverse the root directory and collect file and directory paths 遍历根目录,收集文件和目录路径 More...
 
def path (self)
 Return collected paths (deep copy to avoid mutation) 返回收集到的路径(深拷贝以避免被修改) More...
 

Detailed Description

The Path class definition 路径定义类

provide functionalities for obtaining the paths of source files and directories
提供源码和文件夹路径获取功能

Definition at line 23 of file getPath.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  mode 
)

Initialize the Path object with a traversal mode 使用遍历模式初始化Path对象

Parameters
modePath traversal mode:
  • 'D' Get first-level subdirectories only 只获取根目录下的一级子目录
  • 'F' Get first-level files only 只获取根目录下的一级子文件
  • 'DF' Get all files and subdirectories 获取根目录下所有的子目录和文件

Definition at line 31 of file getPath.py.

Member Function Documentation

◆ clc()

def clc (   self)

Clear previously collected path data for reuse 清空之前收集的路径数据以便复用

Definition at line 51 of file getPath.py.

◆ getPath()

def getPath (   self,
  rootDir 
)

Traverse the root directory and collect file and directory paths 遍历根目录,收集文件和目录路径

Parameters
rootDirThe root directory to traverse
Returns
Path to the first requirements.txt found, or None

Definition at line 60 of file getPath.py.

◆ path()

path (   self)

Return collected paths (deep copy to avoid mutation) 返回收集到的路径(深拷贝以避免被修改)

Returns
List of file paths (for F/DF modes) or directory paths (for D mode)

Definition at line 43 of file getPath.py.


The documentation for this class was generated from the following file: