mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 05:08:28 +03:00
refactoring and renaming
This commit is contained in:
@@ -51,8 +51,11 @@ class Config:
|
||||
self.sheet = getattr_or(self.args, "sheet", execution.get("sheet"))
|
||||
assert self.sheet is not None, "'sheet' must be provided either through command line or configuration file"
|
||||
|
||||
self.worksheet_whitelist = execution.get("worksheet_whitelist")
|
||||
self.worksheet_blacklist = execution.get("worksheet_blacklist")
|
||||
def ensure_set(l):
|
||||
l = l if isinstance(l, list) else [l]
|
||||
return set([x for x in l if isinstance(x, str) and len(x) > 0])
|
||||
self.worksheet_allow = ensure_set(execution.get("worksheet_allow", []))
|
||||
self.worksheet_block = ensure_set(execution.get("worksheet_block", []))
|
||||
|
||||
self.header = int(getattr_or(self.args, "header", execution.get("header", 1)))
|
||||
self.storage = getattr_or(self.args, "storage", execution.get("storage", "s3"))
|
||||
@@ -250,6 +253,8 @@ class Config:
|
||||
return json.dumps({
|
||||
"config_file": self.config_file,
|
||||
"sheet": self.sheet,
|
||||
"worksheet_allow": list(self.worksheet_allow),
|
||||
"worksheet_block": list(self.worksheet_block),
|
||||
"storage": self.storage,
|
||||
"header": self.header,
|
||||
"check_if_exists": self.check_if_exists,
|
||||
|
||||
Reference in New Issue
Block a user