imdiff 0.2.7__tar.gz → 0.2.8__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.
Files changed (31) hide show
  1. {imdiff-0.2.7 → imdiff-0.2.8}/PKG-INFO +1 -1
  2. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/dir_diff_main_window.py +3 -3
  3. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/file_list_frame.py +9 -14
  4. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/image_frame.py +6 -0
  5. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/version.py +1 -1
  6. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff.egg-info/PKG-INFO +1 -1
  7. {imdiff-0.2.7 → imdiff-0.2.8}/LICENSE +0 -0
  8. {imdiff-0.2.7 → imdiff-0.2.8}/README.md +0 -0
  9. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/__init__.py +0 -0
  10. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/__main__.py +0 -0
  11. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/cli/__init__.py +0 -0
  12. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/cli/dir_diff.py +0 -0
  13. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/cli/image_diff.py +0 -0
  14. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/cli/main.py +0 -0
  15. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/__init__.py +0 -0
  16. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/image_canvas.py +0 -0
  17. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/image_diff_main_window.py +0 -0
  18. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/image_scaling.py +0 -0
  19. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/status_bar.py +0 -0
  20. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/transient_menu.py +0 -0
  21. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/gui/zoom_menu.py +0 -0
  22. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/image_comparator.py +0 -0
  23. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/list_files.py +0 -0
  24. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff/util.py +0 -0
  25. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff.egg-info/SOURCES.txt +0 -0
  26. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff.egg-info/dependency_links.txt +0 -0
  27. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff.egg-info/entry_points.txt +0 -0
  28. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff.egg-info/requires.txt +0 -0
  29. {imdiff-0.2.7 → imdiff-0.2.8}/imdiff.egg-info/top_level.txt +0 -0
  30. {imdiff-0.2.7 → imdiff-0.2.8}/pyproject.toml +0 -0
  31. {imdiff-0.2.7 → imdiff-0.2.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imdiff
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Compare image files in different directories
5
5
  Author-email: "John T. Goetz" <theodore.goetz@gmail.com>
6
6
  Project-URL: homepage, https://gitlab.com/johngoetz/imdiff
@@ -74,12 +74,12 @@ class DirDiffMainWindow(ttk.Window):
74
74
  sys.exit()
75
75
 
76
76
  def on_select(self, comparator):
77
+ self.after_idle(self.image_frame.clear)
78
+ self.after_idle(self.status_bar.clear)
79
+ self.update_idletasks()
77
80
  if comparator:
78
81
  self.after_idle(self.image_frame.load_comparator, comparator)
79
82
  self.after_idle(self.status_bar.update_labels, comparator)
80
- else:
81
- self.after_idle(self.image_frame.clear)
82
- self.after_idle(self.status_bar.clear)
83
83
 
84
84
  def update_item(self, file_path, comparator):
85
85
  self.after_idle(self.file_list_frame.update_file_item, file_path)
@@ -161,7 +161,7 @@ class FileListFrame(ttk.Frame):
161
161
  if file_path := self.file_treeview.focus():
162
162
  if self.on_select_command and self.files:
163
163
  self.on_select_command(self.files[file_path])
164
- self.update_file_item(file_path)
164
+ self.after_idle(self.update_file_item, file_path)
165
165
  else:
166
166
  self.on_select_command(None)
167
167
  return 'break'
@@ -237,7 +237,8 @@ class FileListFrame(ttk.Frame):
237
237
  self.file_treeview.heading('#0', command=lambda: self.sort_filepaths(0, True))
238
238
  self.file_treeview.heading('stat', command=lambda: self.sort_stat(False))
239
239
 
240
- def get_diff_info(self, file_path):
240
+ @staticmethod
241
+ def get_diff_info(file_path, comparator):
241
242
  category_chars = {
242
243
  'identical': '=',
243
244
  'missing': '-',
@@ -247,13 +248,6 @@ class FileListFrame(ttk.Frame):
247
248
  'not-found': 'F',
248
249
  }
249
250
 
250
- comparator = self.files[file_path]
251
-
252
- proc = multiprocessing.Process(target=comparator.calculate_diff_info)
253
- proc.start()
254
- while proc.is_alive():
255
- self.update()
256
- time.sleep(0.1)
257
251
  diff_info = comparator.diff_info
258
252
 
259
253
  if diff_info == 'failed-to-load':
@@ -273,17 +267,17 @@ class FileListFrame(ttk.Frame):
273
267
  @separate_thread
274
268
  def process_files(self):
275
269
  while self.file_processing_queue.status == IterableQueue.Status.Filling:
276
- self.update()
270
+ self.update_idletasks()
277
271
  assert self.file_processing_queue.status == IterableQueue.Status.Complete
278
272
  assert self.file_properties_queue.status == IterableQueue.Status.Filling
279
- with concurrent.futures.ThreadPoolExecutor() as executor:
273
+ with concurrent.futures.ProcessPoolExecutor() as executor:
280
274
  self.executor = executor
281
275
  try:
282
276
  jobs = []
283
277
  for file_path in self.file_processing_queue:
284
- jobs.append(executor.submit(self.get_diff_info, file_path))
278
+ jobs.append(executor.submit(
279
+ FileListFrame.get_diff_info, file_path, self.files[file_path]))
285
280
  for job in concurrent.futures.as_completed(jobs):
286
- self.update()
287
281
  file_path, category, diff_info = job.result()
288
282
  self.file_properties_queue.put((file_path, category, diff_info))
289
283
  self.file_properties_queue.status = IterableQueue.Status.Complete
@@ -395,7 +389,8 @@ class FileListFrame(ttk.Frame):
395
389
  self.delete(file_path)
396
390
  return
397
391
 
398
- file_path, category, diff_info = self.get_diff_info(file_path)
392
+ res = FileListFrame.get_diff_info(file_path, self.files[file_path])
393
+ file_path, category, diff_info = res
399
394
  self.set_file_properties(file_path, category, diff_info)
400
395
 
401
396
  def sort_filepaths(self, nparts, reverse):
@@ -1,5 +1,7 @@
1
1
  import logging
2
2
  import platform
3
+ import multiprocessing
4
+ import time
3
5
 
4
6
  import tkinter as tk
5
7
  import ttkbootstrap as ttk
@@ -10,6 +12,8 @@ from .image_canvas import ImageCanvas
10
12
  from .image_scaling import ImageScaling
11
13
  from .zoom_menu import ZoomMenu
12
14
 
15
+ from ..util import separate_thread
16
+
13
17
 
14
18
  log = logging.getLogger(__name__)
15
19
 
@@ -258,12 +262,14 @@ class ImageFrame(ttk.Frame):
258
262
  self.images['diff'].scaled_image = None
259
263
  self.images['diff'].load_image(self.comparator.diff)
260
264
 
265
+ @separate_thread
261
266
  def load_images(self, left, right):
262
267
  self.comparator = ImageComparator(left, right)
263
268
  self.images['left'].load_image(self.comparator.left)
264
269
  self.images['right'].load_image(self.comparator.right)
265
270
  self.show_diff()
266
271
 
272
+ @separate_thread
267
273
  def load_comparator(self, comparator):
268
274
  self.comparator = comparator
269
275
  self.images['left'].load_image(self.comparator.left)
@@ -1,2 +1,2 @@
1
- __version__ = '0.2.7'
1
+ __version__ = '0.2.8'
2
2
  version_info = __version__.split('.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: imdiff
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Compare image files in different directories
5
5
  Author-email: "John T. Goetz" <theodore.goetz@gmail.com>
6
6
  Project-URL: homepage, https://gitlab.com/johngoetz/imdiff
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes