Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit d93ac1c

Browse files
committed
Clean: Black.
1 parent 8be9e13 commit d93ac1c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

runestone/server/componentdb.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_dburl(outer={}):
8484
# DAL uses "postgres:", while SQLAlchemy (and the PostgreSQL spec) uses "postgresql:". Fix.
8585
remove_prefix = "postgres://"
8686
if dburl.startswith(remove_prefix):
87-
dburl = "postgresql://" + dburl[len(remove_prefix):]
87+
dburl = "postgresql://" + dburl[len(remove_prefix) :]
8888
return dburl
8989

9090
raise RuntimeError("Cannot configure a Database URL!")
@@ -129,7 +129,9 @@ def setup(app):
129129
try:
130130
dburl = get_dburl()
131131
# SQLite doesn't support ``client_encoding``, while PostgreSQL does.
132-
encoding = dict(client_encoding="utf8") if dburl.startswith("postgresql") else {}
132+
encoding = (
133+
dict(client_encoding="utf8") if dburl.startswith("postgresql") else {}
134+
)
133135
engine = create_engine(dburl, convert_unicode=True, **encoding)
134136
Session = sessionmaker()
135137
engine.connect()
@@ -341,7 +343,7 @@ def addQuestionToDB(self):
341343
practice=practice,
342344
topic=topics,
343345
from_source=from_source,
344-
review_flag='F',
346+
review_flag="F",
345347
optional=optional,
346348
description=et,
347349
**meta_opts,
@@ -416,7 +418,9 @@ def addQNumberToDB(app, node, qnumber):
416418
questions.c.base_course == basecourse,
417419
)
418420
)
419-
.values(qnumber=qnumber,)
421+
.values(
422+
qnumber=qnumber,
423+
)
420424
)
421425
sess.execute(stmt)
422426

0 commit comments

Comments
 (0)