Skip to content

Commit 3553172

Browse files
committed
fix observer path handling
bump to 1.0.15
1 parent feebd9f commit 3553172

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "htmlcmp"
3-
version = "1.0.13"
3+
version = "1.0.15"
44
description = "Compare HTML files by rendered output"
55
classifiers = []
66
authors = [

src/htmlcmp/compare_output_server.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ def __init__(self, path):
3333
self._path = path
3434

3535
def dispatch(self, event):
36-
if event.event_type in ["opened"]:
37-
return
36+
event_type = event.event_type
37+
src_path = Path(event.src_path)
3838

39-
if event.src_path.is_file():
40-
Config.comparator.submit(event.src_path.relative_to(self._path))
39+
if event_type in ["opened"]:
40+
return
4141

42+
if src_path.is_file():
43+
Config.comparator.submit(src_path.relative_to(self._path))
4244
self._observer = watchdog.observers.Observer()
4345
self._observer.schedule(Handler(Config.path_a), Config.path_a, recursive=True)
4446
self._observer.schedule(Handler(Config.path_b), Config.path_b, recursive=True)

0 commit comments

Comments
 (0)