thread-order 1.2.0__tar.gz → 1.2.2__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 (23) hide show
  1. {thread_order-1.2.0/thread_order.egg-info → thread_order-1.2.2}/PKG-INFO +2 -3
  2. {thread_order-1.2.0 → thread_order-1.2.2}/README.md +1 -2
  3. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/__init__.py +1 -1
  4. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/ui/app.py +33 -22
  5. {thread_order-1.2.0 → thread_order-1.2.2/thread_order.egg-info}/PKG-INFO +2 -3
  6. {thread_order-1.2.0 → thread_order-1.2.2}/LICENSE +0 -0
  7. {thread_order-1.2.0 → thread_order-1.2.2}/pyproject.toml +0 -0
  8. {thread_order-1.2.0 → thread_order-1.2.2}/setup.cfg +0 -0
  9. {thread_order-1.2.0 → thread_order-1.2.2}/tests/test_graph.py +0 -0
  10. {thread_order-1.2.0 → thread_order-1.2.2}/tests/test_init.py +0 -0
  11. {thread_order-1.2.0 → thread_order-1.2.2}/tests/test_scheduler.py +0 -0
  12. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/graph.py +0 -0
  13. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/graph_summary.py +0 -0
  14. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/logger.py +0 -0
  15. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/runner.py +0 -0
  16. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/scheduler.py +0 -0
  17. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/timer.py +0 -0
  18. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order/ui/__init__.py +0 -0
  19. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order.egg-info/SOURCES.txt +0 -0
  20. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order.egg-info/dependency_links.txt +0 -0
  21. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order.egg-info/entry_points.txt +0 -0
  22. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order.egg-info/requires.txt +0 -0
  23. {thread_order-1.2.0 → thread_order-1.2.2}/thread_order.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thread-order
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: A lightweight framework for running functions concurrently across multiple threads while maintaining a defined execution order.
5
5
  Author-email: Emilio Reyes <soda480@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -71,7 +71,7 @@ Use it when you want:
71
71
  * DAG visualization — inspect your dependency graph with --graph
72
72
  * Simple, extensible design — no external dependencies
73
73
  * Prebuilt Docker image available to run tdrun with no local setup required
74
- * Optional GUI ([ui] extra): A Windows GUI for loading task files, previewing DAG dependencies, configuring workers/state, and running the scheduler with live progress and results
74
+ * Optional GUI: A visual alternative to the CLI with deterministic execution visibility, live thread monitoring, and progress feedback
75
75
 
76
76
  ### About the DAG
77
77
 
@@ -107,7 +107,6 @@ You get:
107
107
  * Functions with failed dependendencies are skipped (default behaivor)
108
108
  * Progress Bar integration-ready - requires [progress1bar](https://pypi.org/project/progress1bar) package.
109
109
  * Thread Viewer integration-ready - requires [thread-viewer](https://pypi.org/project/thread-viewer/) package.
110
- * User Interface application via `ui` extra.
111
110
 
112
111
  ### CLI usage
113
112
  ```bash
@@ -29,7 +29,7 @@ Use it when you want:
29
29
  * DAG visualization — inspect your dependency graph with --graph
30
30
  * Simple, extensible design — no external dependencies
31
31
  * Prebuilt Docker image available to run tdrun with no local setup required
32
- * Optional GUI ([ui] extra): A Windows GUI for loading task files, previewing DAG dependencies, configuring workers/state, and running the scheduler with live progress and results
32
+ * Optional GUI: A visual alternative to the CLI with deterministic execution visibility, live thread monitoring, and progress feedback
33
33
 
34
34
  ### About the DAG
35
35
 
@@ -65,7 +65,6 @@ You get:
65
65
  * Functions with failed dependendencies are skipped (default behaivor)
66
66
  * Progress Bar integration-ready - requires [progress1bar](https://pypi.org/project/progress1bar) package.
67
67
  * Thread Viewer integration-ready - requires [thread-viewer](https://pypi.org/project/thread-viewer/) package.
68
- * User Interface application via `ui` extra.
69
68
 
70
69
  ### CLI usage
71
70
  ```bash
@@ -53,7 +53,7 @@ def __getattr__(name):
53
53
  try:
54
54
  __version__ = _metadata.version(__name__)
55
55
  except _metadata.PackageNotFoundError:
56
- __version__ = '1.2.0'
56
+ __version__ = '1.2.2'
57
57
 
58
58
  if getenv('DEV'):
59
59
  __version__ = f'{__version__}+dev'
@@ -232,7 +232,7 @@ class Runner(tb.Frame):
232
232
 
233
233
  self.table_run = Tableview(
234
234
  master=run_frame,
235
- coldata=['Task'],
235
+ coldata=['#', 'Task'],
236
236
  rowdata=[],
237
237
  paginated=False,
238
238
  autofit=False,
@@ -245,21 +245,18 @@ class Runner(tb.Frame):
245
245
  self.table_run.load_table_data()
246
246
  self.table_run.pack(fill=BOTH, expand=True, padx=4, pady=4)
247
247
 
248
- tv = self.table_run.view
248
+ table_run_view = self.table_run.view
249
249
  cols = self.table_run.get_columns()
250
- task_col = cols[0].cid
251
-
252
- # show the tree column (#0) + headings so we can display an icon
253
- tv.configure(show="tree headings")
254
-
255
- # icon column (#0): fixed width, centered
250
+ num_col = cols[0].cid
251
+ task_col = cols[1].cid
252
+ table_run_view.configure(show='tree headings')
256
253
  ICON_W = 46
257
- tv.heading("#0", text="")
258
- tv.column("#0", width=ICON_W, minwidth=ICON_W, stretch=False, anchor="center")
259
-
260
- # Task column: stretch and left align
261
- tv.heading(task_col, anchor="w")
262
- tv.column(task_col, stretch=True, anchor="w", width=400, minwidth=120)
254
+ table_run_view.heading('#0', text='')
255
+ table_run_view.column('#0', width=ICON_W, minwidth=ICON_W, stretch=False, anchor='center')
256
+ table_run_view.heading(num_col, anchor='w')
257
+ table_run_view.column(num_col, stretch=False, anchor='w', width=40, minwidth=40)
258
+ table_run_view.heading(task_col, anchor='w')
259
+ table_run_view.column(task_col, stretch=True, anchor='w', width=400, minwidth=120)
263
260
 
264
261
  self.after(0, self.hide_all_hscrollbars)
265
262
 
@@ -412,9 +409,14 @@ class Runner(tb.Frame):
412
409
  def on_task_done_ui(self, task_name, thread_name, status, count, total):
413
410
  key = str(status.value).upper()
414
411
  icon = self._status_icons.get(key)
415
- self.table_run.insert_row(index=0, values=(task_name,))
412
+ self.table_run.insert_row(index=0, values=(count, task_name,))
416
413
  iid = self.table_run.view.get_children('')[0]
417
414
  self.table_run.view.item(iid, image=icon)
415
+ # highlight row that was just inserted
416
+ tv = self.table_run.view
417
+ tv.selection_set(iid)
418
+ tv.focus(iid)
419
+ tv.see(iid)
418
420
 
419
421
  if key == 'PASSED':
420
422
  self.passed_var.set(self.passed_var.get() + 1)
@@ -486,7 +488,7 @@ class Runner(tb.Frame):
486
488
  self._uiqueue_put(self._set_running_ui, False)
487
489
  finally:
488
490
  self._running = False
489
- # print('state' + json.dumps(self.scheduler.sanitized_state, indent=2, default=str))
491
+ print('state' + json.dumps(self.scheduler.sanitized_state, indent=2, default=str))
490
492
 
491
493
  threading.Thread(target=runner, name='tdrun-scheduler', daemon=True).start()
492
494
 
@@ -561,27 +563,36 @@ class Runner(tb.Frame):
561
563
  with open(path, 'r', encoding='utf-8') as f:
562
564
  data = json.load(f)
563
565
  except Exception as e:
564
- raise ValueError(f'Failed to load JSON file: {pat}') from e
566
+ raise ValueError(f'Failed to load JSON file: {path}') from e
567
+
565
568
  if not isinstance(data, dict):
566
569
  raise ValueError('State JSON must be an object (key/value pairs)')
570
+
567
571
  if any(k.startswith('_') for k in data.keys()):
568
572
  raise ValueError('State file keys cannot start with an underscore (_) character')
573
+
569
574
  for key, value in data.items():
570
575
  if isinstance(value, (dict, list)):
571
576
  value_str = json.dumps(value)
572
577
  else:
573
578
  value_str = str(value)
574
579
  self._upsert_state_row(key, value_str, Path(path).name)
580
+
575
581
  self.table_state.autofit_columns()
576
582
 
577
583
  def get_state_from_table(self):
584
+
585
+ def _parse_value(value):
586
+ try:
587
+ return json.loads(value)
588
+ except Exception:
589
+ return value
590
+
578
591
  state = {}
579
592
  tv = self.table_state.view
580
593
  for iid in tv.get_children(''):
581
- values = tv.item(iid, 'values')
582
- key = values[0]
583
- value = values[1]
584
- state[key] = value
594
+ key, value = tv.item(iid, 'values')[:2]
595
+ state[key] = _parse_value(value)
585
596
  return state
586
597
 
587
598
  def _upsert_state_row(self, key, value_str, source):
@@ -604,7 +615,7 @@ class Runner(tb.Frame):
604
615
  " threads while maintaining a defined execution order.\n\n"
605
616
  "Author: Emilio Reyes\n"
606
617
  "Email: soda480@gmail.com\n\n"
607
- "Package: thread-order[winui]\n"
618
+ "Package: thread-order[ui]\n"
608
619
  f"Version: {version}\n"
609
620
  "https://pypi.org/project/thread-order/\n\n"
610
621
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thread-order
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Summary: A lightweight framework for running functions concurrently across multiple threads while maintaining a defined execution order.
5
5
  Author-email: Emilio Reyes <soda480@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -71,7 +71,7 @@ Use it when you want:
71
71
  * DAG visualization — inspect your dependency graph with --graph
72
72
  * Simple, extensible design — no external dependencies
73
73
  * Prebuilt Docker image available to run tdrun with no local setup required
74
- * Optional GUI ([ui] extra): A Windows GUI for loading task files, previewing DAG dependencies, configuring workers/state, and running the scheduler with live progress and results
74
+ * Optional GUI: A visual alternative to the CLI with deterministic execution visibility, live thread monitoring, and progress feedback
75
75
 
76
76
  ### About the DAG
77
77
 
@@ -107,7 +107,6 @@ You get:
107
107
  * Functions with failed dependendencies are skipped (default behaivor)
108
108
  * Progress Bar integration-ready - requires [progress1bar](https://pypi.org/project/progress1bar) package.
109
109
  * Thread Viewer integration-ready - requires [thread-viewer](https://pypi.org/project/thread-viewer/) package.
110
- * User Interface application via `ui` extra.
111
110
 
112
111
  ### CLI usage
113
112
  ```bash
File without changes
File without changes