Skip to content

Commit a74f96a

Browse files
committed
Bump flake8, fix f-string issues
1 parent 4410491 commit a74f96a

File tree

8 files changed

+21
-18
lines changed

8 files changed

+21
-18
lines changed

flask-google-login/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def unauthorized():
5151
# OAuth2 client setup
5252
client = WebApplicationClient(GOOGLE_CLIENT_ID)
5353

54+
5455
# Flask-Login helper to retrieve a user from our db
5556
@login_manager.user_loader
5657
def load_user(user_id):

python-sockets-tutorial/libclient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ def close(self):
126126
self.selector.unregister(self.sock)
127127
except Exception as e:
128128
print(
129-
f"error: selector.unregister() exception for",
129+
"error: selector.unregister() exception for",
130130
f"{self.addr}: {repr(e)}",
131131
)
132132

133133
try:
134134
self.sock.close()
135135
except OSError as e:
136136
print(
137-
f"error: socket.close() exception for",
137+
"error: socket.close() exception for",
138138
f"{self.addr}: {repr(e)}",
139139
)
140140
finally:

python-sockets-tutorial/libserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ def close(self):
146146
self.selector.unregister(self.sock)
147147
except Exception as e:
148148
print(
149-
f"error: selector.unregister() exception for",
149+
"error: selector.unregister() exception for",
150150
f"{self.addr}: {repr(e)}",
151151
)
152152

153153
try:
154154
self.sock.close()
155155
except OSError as e:
156156
print(
157-
f"error: socket.close() exception for",
157+
"error: socket.close() exception for",
158158
f"{self.addr}: {repr(e)}",
159159
)
160160
finally:

python-sqlite-sqlalchemy/project/examples/example_5/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def get_authors(connection) -> List:
6464
:return: list of authors data
6565
"""
6666
cursor = connection.cursor()
67-
sql = f"""
67+
sql = """
6868
SELECT
6969
a.fname || ' ' || a.lname as author,
7070
b.title,
@@ -105,14 +105,14 @@ def add_new_book(connection, author_name, book_title, publisher_name):
105105
cursor = connection.cursor()
106106

107107
# Does the book exist?
108-
sql = f"""SELECT 1 FROM book WHERE title = ?"""
108+
sql = """SELECT 1 FROM book WHERE title = ?"""
109109
book = cursor.execute(sql, (book_title,)).fetchone()
110110

111111
if book is not None:
112112
raise Exception("Book exists", book_title)
113113

114114
# Get author
115-
sql = f"""
115+
sql = """
116116
SELECT
117117
author_id
118118
FROM author
@@ -127,7 +127,7 @@ def add_new_book(connection, author_name, book_title, publisher_name):
127127
raise Exception("No author found", author_name)
128128

129129
# Get publisher
130-
sql = f"""
130+
sql = """
131131
SELECT
132132
publisher_id
133133
FROM publisher
@@ -140,15 +140,15 @@ def add_new_book(connection, author_name, book_title, publisher_name):
140140
raise Exception("No publisher found", publisher_name)
141141

142142
# Add the book
143-
sql = f"""
143+
sql = """
144144
INSERT INTO book
145145
(title, author_id)
146146
VALUES(?, ?)
147147
"""
148148
book_id = cursor.execute(sql, (book_title, author["author_id"])).lastrowid
149149

150150
# Update the relationships
151-
sql = f"""
151+
sql = """
152152
INSERT INTO book_publisher
153153
(book_id, publisher_id)
154154
VALUES(?, ?)

python-type-checking/hearts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ def __len__(self) -> int:
7070
def __getitem__(self, key: int) -> Card:
7171
...
7272

73-
@overload # noqa
74-
def __getitem__(self, key: slice) -> "Deck":
73+
@overload
74+
def __getitem__(self, key: slice) -> "Deck": # noqa
7575
...
7676

7777
def __getitem__( # noqa

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
black==19.10b0
2-
flake8==3.7.9
2+
flake8==3.8.2

storing-images/storing_images.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def store_single_lmdb(image, image_id, label):
113113
map_size = image.nbytes * 10
114114

115115
# Create a new LMDB environment
116-
env = lmdb.open(str(lmdb_dir / f"single_lmdb"), map_size=map_size)
116+
env = lmdb.open(str(lmdb_dir / "single_lmdb"), map_size=map_size)
117117

118118
# Start a new write transaction
119119
with env.begin(write=True) as txn:
@@ -396,7 +396,7 @@ def read_single_lmdb(image_id):
396396
"""
397397

398398
# Open the LMDB environment; see (1)
399-
env = lmdb.open(str(lmdb_dir / f"single_lmdb"), readonly=True)
399+
env = lmdb.open(str(lmdb_dir / "single_lmdb"), readonly=True)
400400

401401
# Start a new read transaction
402402
with env.begin() as txn:

web-scraping-bs4/job_search.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ def scrape_jobs(location=None):
1212
:rtype: BeautifulSoup object
1313
"""
1414
if location:
15-
URL = f"https://www.monster.com/jobs/search/\
16-
?q=Software-Developer&where={location}"
15+
URL = (
16+
f"https://www.monster.com/jobs/search/"
17+
f"?q=Software-Developer&where={location}"
18+
)
1719
else:
18-
URL = f"https://www.monster.com/jobs/search/?q=Software-Developer"
20+
URL = "https://www.monster.com/jobs/search/?q=Software-Developer"
1921
page = requests.get(URL)
2022

2123
soup = BeautifulSoup(page.content, "html.parser")

0 commit comments

Comments
 (0)