mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-25 09:03:41 +01:00
Correct docstrings
This commit is contained in:
parent
d5c186a389
commit
eba5a00334
@ -10,7 +10,7 @@ By default, the larger torrents are prioritized in descending order, but the
|
|||||||
script can be run with the --smaller flag to prioritize smaller torrents in
|
script can be run with the --smaller flag to prioritize smaller torrents in
|
||||||
ascending order.
|
ascending order.
|
||||||
|
|
||||||
The script will select only torrents with <max_seeders>.
|
The script will select only torrents with less than or equal to <max_seeders>.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
scihub_knapsack.py [--smaller] [--dry-run] -H <hostname> -U <username> -P <password> -S <size> -s <max_seeders>
|
scihub_knapsack.py [--smaller] [--dry-run] -H <hostname> -U <username> -P <password> -S <size> -s <max_seeders>
|
||||||
@ -33,8 +33,8 @@ Options:
|
|||||||
-S <size> The maximum size, in GiB or TiB, of the knapsack to add Sci
|
-S <size> The maximum size, in GiB or TiB, of the knapsack to add Sci
|
||||||
Hub torrents to. Must be a positive integer or float. Must
|
Hub torrents to. Must be a positive integer or float. Must
|
||||||
have either G or T on the end, which represents GiB or TiB.
|
have either G or T on the end, which represents GiB or TiB.
|
||||||
-s <max_seeders> Select torrents with <max_seeders> seeders. <max_seeders>
|
-s <max_seeders> Select torrents with less than or equal to <max_seeders>
|
||||||
is a positive integer argument.
|
seeders. <max_seeders> is a positive integer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
@ -112,7 +112,8 @@ def fill_knapsack(
|
|||||||
Fill the knapsack.
|
Fill the knapsack.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
max_seeders: int -- Select only torrents with this number of seeders
|
max_seeders: int -- Select only torrents with less than or equal to
|
||||||
|
this number of seeders
|
||||||
knapsack_size: int -- The size in bytes of the knapsack
|
knapsack_size: int -- The size in bytes of the knapsack
|
||||||
smaller: bool -- Prioritize smaller sized torrents (Default = False)
|
smaller: bool -- Prioritize smaller sized torrents (Default = False)
|
||||||
|
|
||||||
@ -120,7 +121,7 @@ def fill_knapsack(
|
|||||||
A list of dictionaries that represent the torrents.
|
A list of dictionaries that represent the torrents.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# List of torrents with <max_seeders>
|
# List of torrents with less than or equal to <max_seeders>
|
||||||
torrents = [t for t in get_torrent_health_data() if t["seeders"] <= max_seeders]
|
torrents = [t for t in get_torrent_health_data() if t["seeders"] <= max_seeders]
|
||||||
|
|
||||||
# Sorted list of torrents with <max_seeders>. If smaller == True, sort them
|
# Sorted list of torrents with <max_seeders>. If smaller == True, sort them
|
||||||
|
Loading…
Reference in New Issue
Block a user