Skip to content

Commit

Permalink
Modernize
Browse files Browse the repository at this point in the history
ref #1
  • Loading branch information
michael-k authored and mfa committed May 9, 2024
1 parent f50e154 commit ed9fcb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Python 3
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -r requirements.txt
- name: Run tests with pytest
run: python -m pytest
8 changes: 4 additions & 4 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pip install -r requirements.txt
- name: Fetch latest data and calculate change
run: |-
curl https://service.stuttgart.de/lhs-services/stoerung/ > incidents.html
Expand Down
4 changes: 1 addition & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def parse(contents):
def load_previous_data():
filename = Path(f"data/{today().year}/{str(today())}.csv")
if filename.exists():
reader = csv.DictReader(open(filename))
for row in reader:
yield row
yield from csv.DictReader(open(filename))


def merge(previous_incidents, incidents):
Expand Down

0 comments on commit ed9fcb9

Please sign in to comment.