diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-10-17 01:34:24 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-10-17 01:34:24 +0200 |
commit | fa517a1094a17aff024e9d6c4d2391e7421b27ba (patch) | |
tree | a1730280eae3b39227a8e881ef9344c648bb1ee2 /scripts | |
parent | 792858b1334f442d22feae3e3c257e82825c05df (diff) | |
download | psutil-fa517a1094a17aff024e9d6c4d2391e7421b27ba.tar.gz |
don't use fstrings
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/internal/print_downloads.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/scripts/internal/print_downloads.py b/scripts/internal/print_downloads.py index 81132db9..48828c74 100755 --- a/scripts/internal/print_downloads.py +++ b/scripts/internal/print_downloads.py @@ -57,8 +57,8 @@ def query(cmd): def top_packages(): - return query( - f"pypinfo --all --json --days {DAYS} --limit {LIMIT} '' project") + return query("pypinfo --all --json --days %s --limit %s '' project" % ( + DAYS, LIMIT)) def ranking(): @@ -66,7 +66,7 @@ def ranking(): for i, line in enumerate(data['rows'], 1): if line['project'] == PKGNAME: return i - raise ValueError(f"can't find {PKGNAME}") + raise ValueError("can't find %s" % PKGNAME) def downloads(): @@ -74,23 +74,23 @@ def downloads(): for line in data['rows']: if line['project'] == PKGNAME: return line['download_count'] - raise ValueError(f"can't find {PKGNAME}") + raise ValueError("can't find %s" % PKGNAME) def downloads_pyver(): - return query(f"pypinfo --json --days {DAYS} {PKGNAME} pyversion") + return query("pypinfo --json --days %s %s pyversion" % (DAYS, PKGNAME)) def downloads_by_country(): - return query(f"pypinfo --json --days {DAYS} {PKGNAME} country") + return query("pypinfo --json --days %s %s country" % (DAYS, PKGNAME)) def downloads_by_system(): - return query(f"pypinfo --json --days {DAYS} {PKGNAME} system") + return query("pypinfo --json --days %s %s system" % (DAYS, PKGNAME)) def downloads_by_distro(): - return query(f"pypinfo --json --days {DAYS} {PKGNAME} distro") + return query("pypinfo --json --days %s %s distro" % (DAYS, PKGNAME)) # --- print @@ -123,12 +123,11 @@ def print_markdown_table(title, left, rows): def main(): - last_update = top_packages()['last_update'] print("# Download stats") print("") - s = f"psutil download statistics of the last {DAYS} days (last update " - s += f"*{last_update}*).\n" - s += f"Generated via [pypistats.py]({GITHUB_SCRIPT_URL}) script.\n" + s = "psutil download statistics of the last %s days (last update " % DAYS + s += "*%s*).\n" % top_packages()['last_update'] + s += "Generated via [pypistats.py](%s) script.\n" % GITHUB_SCRIPT_URL print(s) data = [ |