# HG changeset patch # User drewp@bigasterisk.com # Date 1653976520 25200 # Node ID bc643d61bb7ce3e54eeb0fbd83b5120c488cedc9 # Parent a4a060241c7364799daabf05cb629d0093e2e9fd format & comments diff -r a4a060241c73 -r bc643d61bb7c rdfdb/service.py --- a/rdfdb/service.py Mon May 30 22:44:50 2022 -0700 +++ b/rdfdb/service.py Mon May 30 22:55:20 2022 -0700 @@ -15,7 +15,6 @@ from rdfdb.file_vs_uri import DirUriMap from rdfdb.patch import Patch - from rdfdb.shared_graph import SharedGraph log = logging.getLogger('rdfdb') @@ -54,7 +53,7 @@ await websocket.send_json({'connectedAs': self.connectionId}) log.info(f"new ws client {self.connectionId}") - await self.db.addClient(self.connectionId, functools.partial(self._onPatch,websocket)) + await self.db.addClient(self.connectionId, functools.partial(self._onPatch, websocket)) async def _onPatch(self, websocket: WebSocket, p: Patch): await websocket.send_text(p.makeJsonRepr()) diff -r a4a060241c73 -r bc643d61bb7c rdfdb/shared_graph.py --- a/rdfdb/shared_graph.py Mon May 30 22:44:50 2022 -0700 +++ b/rdfdb/shared_graph.py Mon May 30 22:55:20 2022 -0700 @@ -13,7 +13,6 @@ from rdfdb.file_vs_uri import DirUriMap from rdfdb.multigraph import Multigraph from rdfdb.patch import ALLSTMTS, EmptyPatch, Patch - from rdfdb.watched_graphs import WatchedGraphs log = logging.getLogger('shared') diff -r a4a060241c73 -r bc643d61bb7c rdfdb/watched_files.py --- a/rdfdb/watched_files.py Mon May 30 22:44:50 2022 -0700 +++ b/rdfdb/watched_files.py Mon May 30 22:55:20 2022 -0700 @@ -137,8 +137,6 @@ """get inotify events, emit FileEditEvents""" while True: ev = await self._notifier.get() - # log.info(f'got notifier event {ev.path.name if ev.path else None} {ev.mask}') - self._genEvent(ev, ev.path) def _genReadEvent(self, p: Path): @@ -153,6 +151,8 @@ self.fileEditEvents.put_nowait(FileEditEvent(path=p, content=content)) def _genGoneEvent(self, p: Path): + # probably we could reduce this to "a file we tracked is gone" since + # the rest shouldn't matter. And because they're editor swp files. log.info('--> watchevent with FileIsGone') self.fileEditEvents.put_nowait(FileEditEvent(path=p, content=FileIsGone)) diff -r a4a060241c73 -r bc643d61bb7c rdfdb/watched_graphs.py --- a/rdfdb/watched_graphs.py Mon May 30 22:44:50 2022 -0700 +++ b/rdfdb/watched_graphs.py Mon May 30 22:55:20 2022 -0700 @@ -1,8 +1,8 @@ import asyncio import dataclasses import logging +import traceback from pathlib import Path -import traceback from typing import Dict, Iterable, Tuple, cast from rdflib import Graph, URIRef