Fix json loader - it should go in 'validators' not 'utils'

Fixes #214
This commit is contained in:
Patrick Robertson
2025-02-20 13:10:23 +00:00
parent 40488e0869
commit eda359a1ef
7 changed files with 11 additions and 12 deletions

View File

@@ -35,7 +35,7 @@
"replaywebpage": "replaywebpage",
},
"help": "names of columns in the google sheet (stringified JSON object)",
"type": "auto_archiver.utils.json_loader",
"type": "json_loader",
},
"allow_worksheets": {
"default": set(),

View File

@@ -24,9 +24,8 @@ class GsheetsFeeder(Feeder):
def setup(self) -> None:
self.gsheets_client = gspread.service_account(filename=self.service_account)
# TODO mv to validators
assert self.sheet or self.sheet_id, (
"You need to define either a 'sheet' name or a 'sheet_id' in your manifest."
)
if not (self.sheet or self.sheet_id):
raise ValueError("You need to define either a 'sheet' name or a 'sheet_id' in your manifest.")
def open_sheet(self):
if self.sheet:

View File

@@ -18,7 +18,7 @@
"channel_invites": {
"default": {},
"help": "(JSON string) private channel invite links (format: t.me/joinchat/HASH OR t.me/+HASH) and (optional but important to avoid hanging for minutes on startup) channel id (format: CHANNEL_ID taken from a post url like https://t.me/c/CHANNEL_ID/1), the telegram account will join any new channels on setup",
"type": "auto_archiver.utils.json_loader",
"type": "json_loader",
}
},
"description": """