Skip to content

Commit

Permalink
UrlStore: update parameters in get_download_urls() (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
adbar authored Oct 21, 2024
1 parent f6d504d commit ea02ae9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 1 addition & 5 deletions courlan/urlstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,11 @@ def get_url(self, domain: str, as_visited: bool = True) -> Optional[str]:

def get_download_urls(
self,
time_limit: int = 10,
time_limit: float = 10.0,
max_urls: int = 10000,
timelimit: Optional[int] = None, # TODO: remove later
) -> Optional[List[str]]:
"""Get a list of immediately downloadable URLs according to the given
time limit per domain."""
if timelimit is not None:
raise ValueError("timelimit is deprecated, use time_limit instead")

urls = []
for website, entry in self.urldict.items():
if entry.state != State.OPEN:
Expand Down
3 changes: 0 additions & 3 deletions tests/urlstore_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ def test_urlstore():
["https://www.example.org/1", "https://test.org/1", "https://test.org/2"]
)

with pytest.raises(ValueError):
test_urls.get_download_urls(timelimit=0)

downloadable_urls = test_urls.get_download_urls(time_limit=0)
assert (
len(downloadable_urls) == 2
Expand Down

0 comments on commit ea02ae9

Please sign in to comment.