Created
May 12, 2022 04:35
-
-
Save databyjp/0dec7937935649ba56bb3e0c62a993b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yr_ranges = None | |
if len(sys.argv) < 3: | |
logger.info(f'Season year arguments not provided') | |
else: | |
try: | |
if 2040 > int(sys.argv[1]) > 1980 and 2040 > int(sys.argv[2]) > 1980: | |
yr_ranges = [int(sys.argv[1]), int(sys.argv[2])] | |
else: | |
logger.error(f'The arguments should season years (e.g. 2021 2020) when data is available') | |
except: | |
logger.error(f'The arguments should season years (e.g. 2021 2020), instead received {sys.argv[2]} and {sys.argv[3]}') | |
if yr_ranges is None: | |
logger.info(f'Unable to get season year arguments - defaulting to 2021 and 2021') | |
yr_ranges = [2021, 2021] | |
logger.info(f'Updating data between {yr_ranges[0]} and {yr_ranges[1]}.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment