Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/src/python/figure_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def main(args):
plt.tight_layout()

if args.save:
pu.save_fig(fig, args.save)
save_path = args.save if '.' in args.save else args.save + '.pdf'
pu.save_fig(fig, save_path)
else:
plt.show()

Expand Down
7 changes: 4 additions & 3 deletions src/git_commit_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def load_ignore_users(file_path):
import subprocess
from collections import Counter

def get_commits(since=None, until=None, ignore_list=[]):
def get_commits(since=None, until=None, ignore_list=None):
ignore_list = ignore_list or []
# 使用 %ae(邮箱)作为唯一键,%an(用户名)作为显示名
cmd = ["git", "log", "--pretty=%ae|%an"]

Expand All @@ -31,8 +32,8 @@ def get_commits(since=None, until=None, ignore_list=[]):
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding='utf-8')

if result.returncode != 0:
print("git log 执行失败")
return [], {}
print("git log 执行失败{result.stderr.strip()}")
sys.exit(1)

raw_data = result.stdout.strip().split("\n")
email_to_name = {}
Expand Down