Skip to content

Commit

Permalink
problem: wrong place displayed for place 100+; solution: count places…
Browse files Browse the repository at this point in the history
… in a separate variable
  • Loading branch information
kaxap committed Jun 7, 2018
1 parent 681c446 commit 6ca4c28
Show file tree
Hide file tree
Showing 27 changed files with 24,995 additions and 24,992 deletions.
1,918 changes: 959 additions & 959 deletions README-Assembly.md

Large diffs are not rendered by default.

1,986 changes: 993 additions & 993 deletions README-C.md

Large diffs are not rendered by default.

1,996 changes: 998 additions & 998 deletions README-CPP.md

Large diffs are not rendered by default.

1,988 changes: 994 additions & 994 deletions README-CSharp.md

Large diffs are not rendered by default.

1,962 changes: 981 additions & 981 deletions README-Clojure.md

Large diffs are not rendered by default.

1,916 changes: 958 additions & 958 deletions README-CoffeeScript.md

Large diffs are not rendered by default.

1,996 changes: 998 additions & 998 deletions README-Go.md

Large diffs are not rendered by default.

1,896 changes: 948 additions & 948 deletions README-Groovy.md

Large diffs are not rendered by default.

1,936 changes: 968 additions & 968 deletions README-Haskell.md

Large diffs are not rendered by default.

2,000 changes: 1,000 additions & 1,000 deletions README-JS.md

Large diffs are not rendered by default.

2,000 changes: 1,000 additions & 1,000 deletions README-Java.md

Large diffs are not rendered by default.

1,910 changes: 955 additions & 955 deletions README-Lua.md

Large diffs are not rendered by default.

1,898 changes: 949 additions & 949 deletions README-MATLAB.md

Large diffs are not rendered by default.

1,998 changes: 999 additions & 999 deletions README-Node.md

Large diffs are not rendered by default.

2,000 changes: 1,000 additions & 1,000 deletions README-ObjectiveC.md

Large diffs are not rendered by default.

1,990 changes: 995 additions & 995 deletions README-PHP.md

Large diffs are not rendered by default.

1,988 changes: 994 additions & 994 deletions README-Perl.md

Large diffs are not rendered by default.

2,000 changes: 1,000 additions & 1,000 deletions README-Python.md

Large diffs are not rendered by default.

1,934 changes: 967 additions & 967 deletions README-R.md

Large diffs are not rendered by default.

1,970 changes: 985 additions & 985 deletions README-Ruby.md

Large diffs are not rendered by default.

1,966 changes: 983 additions & 983 deletions README-Rust.md

Large diffs are not rendered by default.

926 changes: 463 additions & 463 deletions README-SQL.md

Large diffs are not rendered by default.

1,944 changes: 972 additions & 972 deletions README-Scala.md

Large diffs are not rendered by default.

1,998 changes: 999 additions & 999 deletions README-Swift.md

Large diffs are not rendered by default.

2,000 changes: 1,000 additions & 1,000 deletions README-TypeScript.md

Large diffs are not rendered by default.

1,862 changes: 931 additions & 931 deletions README-VB.net.md

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from last_commit import get_last_commit_date

TABLE_DISCLAIMER = "## This is a most popular repository list for {lng} sorted by number of stars"
TABLE_HEADER = "|STARS|FORKS|ISSUES|LAST COMMIT|NAME|DESCRIPTION|"
TABLE_HEADER = "|STARS|FORKS|ISSUES|LAST COMMIT|NAME/PLACE|DESCRIPTION|"
TABLE_SEPARATOR = "| --- | --- | --- | --- | --- | --- |"
TABLE_ITEM_MASK = "| {n_stars} | {n_forks} | {n_issues} | {updated_at} | [{name}]({url}) | {description} |"
TABLE_ITEM_MASK = "| {n_stars} | {n_forks} | {n_issues} | {updated_at} | [{name}]({url})/{place} | {description} |"
MAX_PAGE = 10
URL_MASK = "https://api.github.com/search/repositories" \
"?q=language:{lng}&sort=stars&order=desc&page={n_page}&per_page=100"
Expand All @@ -30,7 +30,7 @@

languages = ["Python", "Java", "C", "CPP", "SQL", "Node", "CSharp", "PHP", "Ruby", "TypeScript", "Swift", "ObjectiveC",
"VB.net", "Assembly", "R", "Perl", "MATLAB", "Go", "Scala", "Groovy", "Lua", "Haskell", "CoffeeScript",
"Clojure", "Rust"]
"Clojure", "Rust", "JS"]


class WrongReturnCodeException(Exception):
Expand Down Expand Up @@ -99,18 +99,21 @@ def generate_readme(language: str, info_provider: RepositoryInformationProvider)
TABLE_HEADER,
TABLE_SEPARATOR]

place = 0
for n_page in range(1, MAX_PAGE + 1):
data: dict = info_provider.get_next(language, n_page)
for i, item in enumerate(data[KEY_ITEMS]):
# updated = humanize_date(item.get(KEY_UPDATED_AT, None))
last_commit_date = humanize_date(get_last_commit_date(item.get(KEY_REPOSITORY_FULL_NAME, None)))
place += 1

result.append(TABLE_ITEM_MASK.format(n_stars=item.get(KEY_STAR_COUNT),
n_forks=item.get(KEY_FORK_COUNT),
n_issues=item.get(KEY_ISSUE_COUNT),
name=item.get(KEY_REPOSITORY_NAME),
url=item.get(KEY_URL),
description=item.get(KEY_DESCRIPTION),
place=place,
updated_at=last_commit_date))
print(f"{i+1}/{len(data[KEY_ITEMS])}/{n_page}")

Expand Down

0 comments on commit 6ca4c28

Please sign in to comment.