Skip to content

Commit 62fe200

Browse files
committed
Updated the runner template
1 parent 56e53d4 commit 62fe200

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def collect_data(force) -> None:
6161
makedirs(folder_path+'inputs')
6262
except FileExistsError:
6363
pass
64-
response = requests.get(f'https://adventofcode.com/{args.year}/day/{args.day}/input', cookies={'session':config.session_cookie}, headers={'User-Agent': 'github.com/fschatbot/Advent-Calendar-Python/ by FSChatbot'})
64+
try:
65+
response = requests.get(f'https://adventofcode.com/{args.year}/day/{args.day}/input', cookies={'session':config.session_cookie}, headers={'User-Agent': 'github.com/fschatbot/Advent-Calendar-Python/ by FSChatbot'})
66+
except requests.exceptions.ConnectionError:
67+
console.print("[red bold]Seems like we are having some issues with the internet!!")
68+
exit()
6569
raw_data = response.text.strip('\n')
6670
# Save the data for backup
6771
if response.status_code == 200:

runner_template.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from typing import List
5-
64
split_data = True
75
completed = False
86
raw_data = None # Not To be touched
97

10-
def part1(data:List[str]):
8+
def part1(data):
119
...
1210

13-
def part2(data:List[str]):
11+
def part2(data):
1412
...

0 commit comments

Comments
 (0)