fix some mypy lint

This commit is contained in:
ducklet 2020-11-08 10:35:26 +01:00
parent 9d7d80d3a5
commit 7c7a1fcde2
6 changed files with 20 additions and 6 deletions

View file

@ -17,7 +17,7 @@ class Store:
if path:
self.dbpath = path
if self.connection is not None:
return self.connection
return
log.debug("Connecting to %s", self.dbpath)
self.connection = sqlite3.connect(
self.dbpath, isolation_level=None
@ -30,6 +30,7 @@ class Store:
conn.close()
def init(self) -> None:
assert self.connection is not None
conn = self.connection
conn.execute(
"""
@ -57,6 +58,7 @@ class Store:
def sync_feeds(self, feeds: Dict[str, Feed]) -> None:
"""Write the current state of feeds to store, and load existing info back."""
assert self.connection is not None
conn = self.connection
conn.executemany(
"""
@ -117,6 +119,7 @@ class Store:
select id, content, date, link, title from post
where feed_id=? and id in ({qs})
"""
assert self.connection is not None
conn = self.connection
posts = [Post(*row) for row in conn.execute(sql, (feed_id, *post_ids))]
for post in posts: