Mercurial > code > home > repos > rdfdb
changeset 109:bc643d61bb7c
format & comments
author | drewp@bigasterisk.com |
---|---|
date | Mon, 30 May 2022 22:55:20 -0700 |
parents | a4a060241c73 |
children | 703c44bfa3d5 |
files | rdfdb/service.py rdfdb/shared_graph.py rdfdb/watched_files.py rdfdb/watched_graphs.py |
diffstat | 4 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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())
--- 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')
--- 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))
--- 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