parent
a0eaafc12e
commit
102ef3e6ec
1 changed files with 25 additions and 17 deletions
|
@ -19,13 +19,18 @@ class Comments(BaseCommand):
|
|||
for comment in comments:
|
||||
author = comment["author"]["username"], comment["author"]["name"]
|
||||
if author not in result:
|
||||
result[author] = list()
|
||||
result[author] = dict()
|
||||
|
||||
result[author].append(comment)
|
||||
file_path = comment["position"]["new_path"] if "position" in comment else None
|
||||
if file_path not in result[author]:
|
||||
result[author][file_path] = list()
|
||||
|
||||
result[author][file_path].append(comment)
|
||||
|
||||
# sort by lines
|
||||
for author in result:
|
||||
result[author].sort(key=lambda comment:
|
||||
for file_path in result[author]:
|
||||
result[author][file_path].sort(key=lambda comment:
|
||||
comment["position"]["new_line"] if "position" in comment
|
||||
else math.inf)
|
||||
|
||||
|
@ -40,7 +45,10 @@ class Comments(BaseCommand):
|
|||
header = f"***** {name} ({login}) *****".center(40, "*").center(80)
|
||||
print(header)
|
||||
|
||||
for comment in comments[author]:
|
||||
for file_path in comments[author]:
|
||||
if file_path is not None:
|
||||
print(f"# `{file_path.split('/')[-1]}`")
|
||||
for comment in comments[author][file_path]:
|
||||
if comment["system"]:
|
||||
continue
|
||||
|
||||
|
|
Reference in a new issue