mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 21:28:29 +03:00
@@ -208,7 +208,7 @@ def read_yaml(yaml_filename: str) -> CommentedMap:
|
||||
pass
|
||||
|
||||
if not config:
|
||||
config = EMPTY_CONFIG
|
||||
config = deepcopy(EMPTY_CONFIG)
|
||||
|
||||
return config
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# used as validators for config values. Should raise an exception if the value is invalid.
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
import json
|
||||
|
||||
def example_validator(value):
|
||||
if "example" not in value:
|
||||
@@ -16,4 +17,7 @@ def positive_number(value):
|
||||
def valid_file(value):
|
||||
if not Path(value).is_file():
|
||||
raise argparse.ArgumentTypeError(f"File '{value}' does not exist.")
|
||||
return value
|
||||
return value
|
||||
|
||||
def json_loader(cli_val):
|
||||
return json.loads(cli_val)
|
||||
Reference in New Issue
Block a user