Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 22, 2022
1 parent d082939 commit 1b858b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/contents/fps_contents/fileid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from fps.logging import get_configured_logger # type: ignore
from watchfiles import Change, awatch


watchfiles_logger = get_configured_logger("watchfiles.main")
watchfiles_logger.setLevel(logging.CRITICAL)
logger = get_configured_logger("contents")
Expand All @@ -34,6 +33,7 @@ def notify(self, change):

class Singleton(type):
_instances = {}

def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
Expand Down Expand Up @@ -133,7 +133,9 @@ async def watch_files(self):
logger.debug("File %s is not indexed, ignoring", changed_path_str)
continue
mtime = (await changed_path.stat()).st_mtime
await db.execute("UPDATE fileids SET mtime = ? WHERE path = ?", (mtime, changed_path_str))
await db.execute(
"UPDATE fileids SET mtime = ? WHERE path = ?", (mtime, changed_path_str)
)

for path in deleted_paths + added_paths:
await db.execute("DELETE FROM fileids WHERE path = ?", (path,))
Expand Down

0 comments on commit 1b858b9

Please sign in to comment.