Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaul committed Jan 3, 2025
1 parent 633ed81 commit c570029
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions scripts/gpo_member_photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
import json
import os
import re
import sys
import time
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlretrieve

# pip install -r requirements.txt
Expand Down Expand Up @@ -73,7 +71,8 @@ def get_legislators_current(br, include_historical=False):
).json()
if include_historical:
historical = br.get(
"https://theunitedstates.io/congress-legislators/legislators-historical.json"
"https://theunitedstates.io/congress-legislators/"
"legislators-historical.json"
).json()
legislators += historical
return legislators
Expand Down Expand Up @@ -182,19 +181,17 @@ def resize_photos():
if "pictorial" in m["id"]:
try:
pictorial_data = next(
(
p
for p in members_pictorial
if p["memberId"] == m["id"]["pictorial"]
)
p
for p in members_pictorial
if p["memberId"] == m["id"]["pictorial"]
)

if "nophotoimage.jpg" in pictorial_data["imageUrl"]:
pass
else:
image_found = True
photo_list.append((m["id"]["bioguide"], pictorial_data["imageUrl"]))
except StopIteration as e:
except StopIteration:
# No matching result from pictorial API
pass

Expand Down

0 comments on commit c570029

Please sign in to comment.