mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 14:44:18 +00:00
feat: move import
This commit is contained in:
parent
648b4c8aab
commit
7008f9b735
3 changed files with 4 additions and 3 deletions
|
@ -49,12 +49,13 @@ def parse_html_main_index(out_dir: Path=OUTPUT_DIR) -> Iterator[str]:
|
||||||
yield line.split('"')[1]
|
yield line.split('"')[1]
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
|
@enforce_types
|
||||||
def generate_index_from_links(links: List[Link], with_headers: bool):
|
def generate_index_from_links(links: List[Link], with_headers: bool):
|
||||||
if with_headers:
|
if with_headers:
|
||||||
output = main_index_template(links)
|
output = main_index_template(links)
|
||||||
else:
|
else:
|
||||||
output = main_index_template(links, template=MINIMAL_INDEX_TEMPLATE)
|
output = main_index_template(links, template=MINIMAL_INDEX_TEMPLATE)
|
||||||
|
return output
|
||||||
|
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def main_index_template(links: List[Link], template: str=MAIN_INDEX_TEMPLATE) -> str:
|
def main_index_template(links: List[Link], template: str=MAIN_INDEX_TEMPLATE) -> str:
|
||||||
|
|
|
@ -8,7 +8,7 @@ from pathlib import Path
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import List, Optional, Iterator, Any, Union
|
from typing import List, Optional, Iterator, Any, Union
|
||||||
|
|
||||||
from .schema import Link, ArchiveResult
|
from .schema import Link
|
||||||
from ..system import atomic_write
|
from ..system import atomic_write
|
||||||
from ..util import enforce_types
|
from ..util import enforce_types
|
||||||
from ..config import (
|
from ..config import (
|
||||||
|
|
|
@ -59,6 +59,7 @@ from .index.sql import (
|
||||||
from .index.html import (
|
from .index.html import (
|
||||||
generate_index_from_links,
|
generate_index_from_links,
|
||||||
)
|
)
|
||||||
|
from .index.csv import links_to_csv
|
||||||
from .extractors import archive_links, archive_link, ignore_methods
|
from .extractors import archive_links, archive_link, ignore_methods
|
||||||
from .config import (
|
from .config import (
|
||||||
stderr,
|
stderr,
|
||||||
|
@ -770,7 +771,6 @@ def list_all(filter_patterns_str: Optional[str]=None,
|
||||||
elif html:
|
elif html:
|
||||||
output = generate_index_from_links(folders.values(), with_headers)
|
output = generate_index_from_links(folders.values(), with_headers)
|
||||||
elif csv:
|
elif csv:
|
||||||
from .index.csv import links_to_csv
|
|
||||||
output = links_to_csv(folders.values(), cols=csv.split(','), header=with_headers)
|
output = links_to_csv(folders.values(), cols=csv.split(','), header=with_headers)
|
||||||
else:
|
else:
|
||||||
output = printable_folders(folders, with_headers=with_headers)
|
output = printable_folders(folders, with_headers=with_headers)
|
||||||
|
|
Loading…
Reference in a new issue