mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Add a CLI option to configure ILIAS links behaviour
This commit is contained in:
parent
4fefb98d71
commit
c21ddf225b
@ -2,7 +2,8 @@ import argparse
|
||||
import configparser
|
||||
from pathlib import Path
|
||||
|
||||
from .parser import CRAWLER_PARSER, SUBPARSERS, BooleanOptionalAction, load_crawler
|
||||
from ..crawl.ilias.file_templates import Links
|
||||
from .parser import CRAWLER_PARSER, SUBPARSERS, BooleanOptionalAction, load_crawler, show_value_error
|
||||
|
||||
SUBPARSER = SUBPARSERS.add_parser(
|
||||
"kit-ilias-web",
|
||||
@ -41,17 +42,18 @@ GROUP.add_argument(
|
||||
action=BooleanOptionalAction,
|
||||
help="use the system keyring to store and retrieve passwords"
|
||||
)
|
||||
GROUP.add_argument(
|
||||
"--links",
|
||||
type=show_value_error(Links.from_string),
|
||||
metavar="OPTION",
|
||||
help="how to treat external links"
|
||||
)
|
||||
GROUP.add_argument(
|
||||
"--link-file-redirect-delay",
|
||||
type=int,
|
||||
metavar="SECONDS",
|
||||
help="delay before external link files redirect you to their target (-1 to disable)"
|
||||
)
|
||||
GROUP.add_argument(
|
||||
"--link-file-plaintext",
|
||||
action=BooleanOptionalAction,
|
||||
help="use plain text files for external links"
|
||||
)
|
||||
GROUP.add_argument(
|
||||
"--http-timeout",
|
||||
type=float,
|
||||
@ -74,8 +76,8 @@ def load(
|
||||
section["auth"] = "auth:kit-ilias-web"
|
||||
if args.link_file_redirect_delay is not None:
|
||||
section["link_file_redirect_delay"] = str(args.link_file_redirect_delay)
|
||||
if args.link_file_plaintext is not None:
|
||||
section["link_file_plaintext"] = str(args.link_file_plaintext)
|
||||
if args.links is not None:
|
||||
section["links"] = str(args.links.value)
|
||||
if args.videos is not None:
|
||||
section["videos"] = str(False)
|
||||
if args.http_timeout is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user