Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed top languages missing bug #536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion sources/graphics_list_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def make_list(data: List = None, names: List[str] = None, texts: List[str] = Non
percents = [value for item in data for key, value in item.items() if key == "percent"] if percents is None else percents

data = list(zip(names, texts, percents))
top_data = sorted(data[:top_num], key=lambda record: record[2], reverse=True) if sort else data[:top_num]
top_data = sorted(data, key=lambda record: record[2], reverse=True)[:top_num] if sort else data[:top_num]
data_list = [f"{n[:25]}{' ' * (25 - len(n))}{t}{' ' * (20 - len(t))}{make_graph(p)} {p:05.2f} % " for n, t, p in top_data]
return "\n".join(data_list)

Expand Down