htmlcmp 1.0.12__tar.gz → 1.0.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: htmlcmp
3
- Version: 1.0.12
3
+ Version: 1.0.15
4
4
  Summary: Compare HTML files by rendered output
5
5
  Author: Andreas Stefl
6
6
  Maintainer-email: Andreas Stefl <stefl.andreas@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "htmlcmp"
3
- version = "1.0.12"
3
+ version = "1.0.15"
4
4
  description = "Compare HTML files by rendered output"
5
5
  classifiers = []
6
6
  authors = [
@@ -12,8 +12,8 @@ from flask import Flask, send_from_directory, send_file
12
12
  import watchdog.observers
13
13
  import watchdog.events
14
14
 
15
- from compare_output import comparable_file, compare_files
16
- from html_render_diff import get_browser, html_render_diff
15
+ from htmlcmp.compare_output import comparable_file, compare_files
16
+ from htmlcmp.html_render_diff import get_browser, html_render_diff
17
17
 
18
18
 
19
19
  class Config:
@@ -33,12 +33,14 @@ class Observer:
33
33
  self._path = path
34
34
 
35
35
  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)
38
38
 
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
41
41
 
42
+ if src_path.is_file():
43
+ Config.comparator.submit(src_path.relative_to(self._path))
42
44
  self._observer = watchdog.observers.Observer()
43
45
  self._observer.schedule(Handler(Config.path_a), Config.path_a, recursive=True)
44
46
  self._observer.schedule(Handler(Config.path_b), Config.path_b, recursive=True)
@@ -52,7 +54,7 @@ class Observer:
52
54
  if not a.is_dir() or not b.is_dir():
53
55
  raise ValueError("Both paths must be directories")
54
56
 
55
- common_path = a / Config.path_a
57
+ common_path = a.relative_to(Config.path_a)
56
58
 
57
59
  left = sorted(p.name for p in a.iterdir())
58
60
  right = sorted(p.name for p in b.iterdir())
@@ -106,8 +108,6 @@ class Comparator:
106
108
  def compare(self, path: Path):
107
109
  if not isinstance(path, Path):
108
110
  raise TypeError("Path must be of type Path")
109
- if not path.is_file():
110
- raise ValueError("Path must be a file")
111
111
  if path not in self._future:
112
112
  raise RuntimeError("Path not submitted for comparison")
113
113
 
@@ -166,7 +166,7 @@ def root():
166
166
  if not a.is_dir() or not b.is_dir():
167
167
  raise ValueError("Both paths must be directories")
168
168
 
169
- common_path = a / Config.path_a
169
+ common_path = a.relative_to(Config.path_a)
170
170
 
171
171
  left = sorted(p.name for p in a.iterdir())
172
172
  right = sorted(p.name for p in b.iterdir())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: htmlcmp
3
- Version: 1.0.12
3
+ Version: 1.0.15
4
4
  Summary: Compare HTML files by rendered output
5
5
  Author: Andreas Stefl
6
6
  Maintainer-email: Andreas Stefl <stefl.andreas@gmail.com>
File without changes
File without changes
File without changes