pgwidgets-python 0.3.4__tar.gz → 0.3.5__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 (77) hide show
  1. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/PKG-INFO +1 -1
  2. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/async_/application.py +8 -0
  3. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/method_types.py +28 -1
  4. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/sync/application.py +8 -0
  5. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets_python.egg-info/PKG-INFO +1 -1
  6. pgwidgets_python-0.3.5/pgwidgets_python.egg-info/scm_version.json +8 -0
  7. pgwidgets_python-0.3.4/pgwidgets_python.egg-info/scm_version.json +0 -8
  8. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/.flake8 +0 -0
  9. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/.github/workflows/tests.yml +0 -0
  10. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/.gitignore +0 -0
  11. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/.readthedocs.yaml +0 -0
  12. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/LICENSE.md +0 -0
  13. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/README.md +0 -0
  14. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/Makefile +0 -0
  15. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/WhatsNew.rst +0 -0
  16. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/api/async.rst +0 -0
  17. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/api/index.rst +0 -0
  18. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/api/sync.rst +0 -0
  19. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/architecture.rst +0 -0
  20. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/async.rst +0 -0
  21. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/callbacks.rst +0 -0
  22. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/conf.py +0 -0
  23. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/extras.rst +0 -0
  24. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/getting-started.rst +0 -0
  25. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/index.rst +0 -0
  26. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/subclassing.rst +0 -0
  27. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/sync.rst +0 -0
  28. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/utilities.rst +0 -0
  29. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/web-servers.rst +0 -0
  30. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/docs/widgets.rst +0 -0
  31. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/README.md +0 -0
  32. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/all_widgets.py +0 -0
  33. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/all_widgets_async.py +0 -0
  34. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/demo_async.py +0 -0
  35. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/demo_sync.py +0 -0
  36. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/demo_treeview.py +0 -0
  37. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/flask-multi-process/README.md +0 -0
  38. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/flask-multi-process/gunicorn.conf.py +0 -0
  39. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/flask-multi-process/nginx.conf +0 -0
  40. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/flask-multi-process/server.py +0 -0
  41. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/examples/flask-multi-process/user_app.py +0 -0
  42. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/__init__.py +0 -0
  43. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/_json.py +0 -0
  44. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/async_/Widgets.py +0 -0
  45. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/async_/__init__.py +0 -0
  46. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/async_/widget.py +0 -0
  47. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/buffer.py +0 -0
  48. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/callbacks.py +0 -0
  49. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/defs.py +0 -0
  50. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/extras/__init__.py +0 -0
  51. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/extras/file_browser.py +0 -0
  52. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/icons/pgw-python-logo.png +0 -0
  53. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/sync/Widgets.py +0 -0
  54. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/sync/__init__.py +0 -0
  55. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/sync/text_source.py +0 -0
  56. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/sync/widget.py +0 -0
  57. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets/text_model.py +0 -0
  58. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets_python.egg-info/SOURCES.txt +0 -0
  59. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets_python.egg-info/dependency_links.txt +0 -0
  60. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets_python.egg-info/requires.txt +0 -0
  61. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets_python.egg-info/scm_file_list.json +0 -0
  62. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pgwidgets_python.egg-info/top_level.txt +0 -0
  63. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/pyproject.toml +0 -0
  64. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/setup.cfg +0 -0
  65. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/test_pg2.py +0 -0
  66. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/__init__.py +0 -0
  67. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_async_session.py +0 -0
  68. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_defs.py +0 -0
  69. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_extras.py +0 -0
  70. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_fonts.py +0 -0
  71. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_protocol.py +0 -0
  72. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_reconstruct.py +0 -0
  73. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_resolve_kwargs.py +0 -0
  74. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_session.py +0 -0
  75. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_stateful.py +0 -0
  76. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_text_source.py +0 -0
  77. {pgwidgets_python-0.3.4 → pgwidgets_python-0.3.5}/tests/test_widget_classes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pgwidgets-python
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: Python bindings for the pgwidgets JavaScript widget library
5
5
  Author: PGWidgets Developers
6
6
  License: BSD-3-Clause
@@ -434,6 +434,14 @@ class Session:
434
434
  widget._state[spec[0]] = tuple(args)
435
435
  else:
436
436
  widget._state[spec] = args[0]
437
+ # ComboBox: a value committed with Enter in the browser may be
438
+ # a new entry the browser appended to its list; mirror that
439
+ # append so our _items (and thus get_index) stays consistent.
440
+ if (widget._js_class == "ComboBox" and action == "activated"
441
+ and len(args) >= 2):
442
+ items = widget._state.setdefault("_items", [])
443
+ if args[1] not in items:
444
+ items.append(args[1])
437
445
 
438
446
  # Dialog autoclose: the JS side auto-hides when a button is
439
447
  # clicked. Sync that to Python so reconstruction doesn't
@@ -108,7 +108,7 @@ ACTION_METHODS = {
108
108
  # Timer
109
109
  "start", "cancel", "set", "cond_set",
110
110
  # Table/Tree row-level modifications (tracked via bulk set_data)
111
- "add_item", "remove_item", "update_tree", "remove_items",
111
+ "add_item", "remove_item", "update_tree", "remove_items", "delete_tree",
112
112
  "insert_row", "append_row", "delete_row",
113
113
  "insert_column", "append_column", "delete_column",
114
114
  "set_cell",
@@ -419,7 +419,34 @@ BINARY_STATE_KEYS = {
419
419
  }
420
420
 
421
421
 
422
+ def _combobox_get_index(self):
423
+ """Index of the item matching the current text, or -1 when the text is
424
+ not one of the offerings (e.g. a value typed into an editable combo box
425
+ but not yet committed with Enter). Mirrors the JS get_index(), which
426
+ is items.indexOf(input value), and stays consistent with get_text()
427
+ (the cached entry text, kept live by the 'modified' callback)."""
428
+ items = self._state.get("_items", [])
429
+ try:
430
+ return items.index(self._state.get("text", ""))
431
+ except ValueError:
432
+ return -1
433
+
434
+
435
+ def _combobox_set_index(self, idx):
436
+ """Select the item at *idx*, keeping the cached text consistent with
437
+ the index so get_text() agrees with get_index() after a programmatic
438
+ change (the generic setter would leave 'text' stale)."""
439
+ items = self._state.get("_items", [])
440
+ if 0 <= idx < len(items):
441
+ self._state["text"] = items[idx]
442
+ self._state["index"] = idx
443
+ self._user_set_state.add("index")
444
+ return self._call("set_index", idx)
445
+
446
+
422
447
  CUSTOM_METHODS = {
448
+ ("ComboBox", "get_index"): _combobox_get_index,
449
+ ("ComboBox", "set_index"): _combobox_set_index,
423
450
  ("TabWidget", "index_to_widget"): _index_to_widget,
424
451
  ("TabWidget", "index_of"): _index_of,
425
452
  ("StackWidget", "index_to_widget"): _index_to_widget,
@@ -524,6 +524,14 @@ class Session:
524
524
  widget._state[spec[0]] = tuple(args)
525
525
  else:
526
526
  widget._state[spec] = args[0]
527
+ # ComboBox: a value committed with Enter in the browser may be
528
+ # a new entry the browser appended to its list; mirror that
529
+ # append so our _items (and thus get_index) stays consistent.
530
+ if (widget._js_class == "ComboBox" and action == "activated"
531
+ and len(args) >= 2):
532
+ items = widget._state.setdefault("_items", [])
533
+ if args[1] not in items:
534
+ items.append(args[1])
527
535
  # Dialog autoclose: the JS side auto-hides when a button is
528
536
  # clicked. Sync that to Python so reconstruction doesn't
529
537
  # re-show a dialog that was autoclosed.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pgwidgets-python
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: Python bindings for the pgwidgets JavaScript widget library
5
5
  Author: PGWidgets Developers
6
6
  License: BSD-3-Clause
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.3.5",
3
+ "distance": 0,
4
+ "node": "gada2d6a3ea7a2cadea81c1df83bef7b463e35fe3",
5
+ "dirty": false,
6
+ "branch": "main",
7
+ "node_date": "2026-07-24"
8
+ }
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.3.4",
3
- "distance": 0,
4
- "node": "g723f82b1856fa1a276455b903e3c9131cb62d9a8",
5
- "dirty": false,
6
- "branch": "main",
7
- "node_date": "2026-07-17"
8
- }