【发布时间】:2022-01-10 20:27:25
【问题描述】:
我是 git、API 和 python 的新手。目前我正在使用 PyDriller 并尝试提取提交的修改文件的最后触摸行。 [我的主要目的是我想找出文件的哪个类拥有这些最后触及的行。 ]
for commit in Repository('testing').traverse_commits():
for modified_file in commit.modified_files:
print(modified_file.get_commits_last_modified_lines)
但它向我显示了如下错误:
AttributeError: 'ModifiedFile' object has no attribute 'get_commits_last_modified_lines'
“get_commits_last_modified_lines”写在 API PyDriller Reference 中。但我不能使用它。我该怎么办?
【问题讨论】:
-
你导入了 Git 吗?如github.com/ishepard/pydriller/blob/….