mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-22 10:55:18 -04:00
fix: Replace any
typing with Union[Iterable[Link], QuerySet] in archive_links
This commit is contained in:
parent
779a446085
commit
0a83392cbf
1 changed files with 2 additions and 2 deletions
|
@ -2,7 +2,7 @@ __package__ = 'archivebox.extractors'
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from typing import Optional, List, Iterable
|
from typing import Optional, List, Iterable, Union, TYPE_CHECKING
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from django.db.models import QuerySet
|
from django.db.models import QuerySet
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ def archive_link(link: Link, overwrite: bool=False, methods: Optional[Iterable[s
|
||||||
return link
|
return link
|
||||||
|
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def archive_links(all_links: any, overwrite: bool=False, methods: Optional[Iterable[str]]=None, out_dir: Optional[str]=None) -> List[Link]:
|
def archive_links(all_links: Union[Iterable[Link], QuerySet], overwrite: bool=False, methods: Optional[Iterable[str]]=None, out_dir: Optional[str]=None) -> List[Link]:
|
||||||
|
|
||||||
if type(all_links) is QuerySet:
|
if type(all_links) is QuerySet:
|
||||||
num_links: int = all_links.count()
|
num_links: int = all_links.count()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue