From 5b0593ce824b8f244f86be4dca9c0b387f6aa9c4 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Thu, 2 Feb 2023 11:00:24 +0000 Subject: [PATCH] arg parse fix --- src/auto_archiver/archivers/telethon_archiver.py | 2 +- src/auto_archiver/feeders/gsheet_feeder.py | 1 - src/auto_archiver/utils/gsheet.py | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/auto_archiver/archivers/telethon_archiver.py b/src/auto_archiver/archivers/telethon_archiver.py index 99af97f..7563af5 100644 --- a/src/auto_archiver/archivers/telethon_archiver.py +++ b/src/auto_archiver/archivers/telethon_archiver.py @@ -29,7 +29,7 @@ class TelethonArchiver(Archiver): "api_id": {"default": None, "help": "telegram API_ID value, go to https://my.telegram.org/apps"}, "api_hash": {"default": None, "help": "telegram API_HASH value, go to https://my.telegram.org/apps"}, # "bot_token": {"default": None, "help": "optional, but allows access to more content such as large videos, talk to @botfather"}, - "session_file": {"default": "secrets/anon", "help": "optional, records the telegram login session for future usage"}, + "session_file": {"default": "secrets/anon", "help": "optional, records the telegram login session for future usage, '.session' will be appended to the provided value."}, "join_channels": {"default": True, "help": "disables the initial setup with channel_invites config, useful if you have a lot and get stuck"}, "channel_invites": { "default": {}, diff --git a/src/auto_archiver/feeders/gsheet_feeder.py b/src/auto_archiver/feeders/gsheet_feeder.py index d5d3fcf..42fdb54 100644 --- a/src/auto_archiver/feeders/gsheet_feeder.py +++ b/src/auto_archiver/feeders/gsheet_feeder.py @@ -15,7 +15,6 @@ class GsheetsFeeder(Gsheets, Feeder): # without this STEP.__init__ is not called super().__init__(config) self.gsheets_client = gspread.service_account(filename=self.service_account) - assert type(self.header) == int, f"header ({self.header}) value must be an integer not {type(self.header)}" @staticmethod def configs() -> dict: diff --git a/src/auto_archiver/utils/gsheet.py b/src/auto_archiver/utils/gsheet.py index f793297..0fec7f9 100644 --- a/src/auto_archiver/utils/gsheet.py +++ b/src/auto_archiver/utils/gsheet.py @@ -10,6 +10,9 @@ class Gsheets(Step): # without this STEP.__init__ is not called super().__init__(config) self.gsheets_client = gspread.service_account(filename=self.service_account) + #TODO: config should be responsible for conversions + try: self.header = int(self.header) + except: pass assert type(self.header) == int, f"header ({self.header}) value must be an integer not {type(self.header)}" assert self.sheet is not None, "You need to define a sheet name in your orchestration file when using gsheets."