mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-12 09:34:50 +02:00
fix: Move csv split to the add function to avoid optional nullable argument
This commit is contained in:
@@ -76,7 +76,6 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||||||
command = parser.parse_args(args or ())
|
command = parser.parse_args(args or ())
|
||||||
urls = command.urls
|
urls = command.urls
|
||||||
stdin_urls = accept_stdin(stdin)
|
stdin_urls = accept_stdin(stdin)
|
||||||
extractors = command.extract.split(",") if command.extract else None
|
|
||||||
if (stdin_urls and urls) or (not stdin and not urls):
|
if (stdin_urls and urls) or (not stdin and not urls):
|
||||||
stderr(
|
stderr(
|
||||||
'[X] You must pass URLs/paths to add via stdin or CLI arguments.\n',
|
'[X] You must pass URLs/paths to add via stdin or CLI arguments.\n',
|
||||||
@@ -91,7 +90,7 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
|
|||||||
overwrite=command.overwrite,
|
overwrite=command.overwrite,
|
||||||
init=command.init,
|
init=command.init,
|
||||||
out_dir=pwd or OUTPUT_DIR,
|
out_dir=pwd or OUTPUT_DIR,
|
||||||
extractors = extractors,
|
extractors = command.extract,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -526,13 +526,12 @@ def add(urls: Union[str, List[str]],
|
|||||||
overwrite: bool=False,
|
overwrite: bool=False,
|
||||||
init: bool=False,
|
init: bool=False,
|
||||||
out_dir: Path=OUTPUT_DIR,
|
out_dir: Path=OUTPUT_DIR,
|
||||||
extractors: list=None) -> List[Link]:
|
extractors: str="") -> List[Link]:
|
||||||
"""Add a new URL or list of URLs to your archive"""
|
"""Add a new URL or list of URLs to your archive"""
|
||||||
|
|
||||||
assert depth in (0, 1), 'Depth must be 0 or 1 (depth >1 is not supported yet)'
|
assert depth in (0, 1), 'Depth must be 0 or 1 (depth >1 is not supported yet)'
|
||||||
|
|
||||||
if extractors is None:
|
extractors = extractors.split(",") if extractors else []
|
||||||
extractors = []
|
|
||||||
|
|
||||||
if init:
|
if init:
|
||||||
run_subcommand('init', stdin=None, pwd=out_dir)
|
run_subcommand('init', stdin=None, pwd=out_dir)
|
||||||
|
Reference in New Issue
Block a user