jbqt 0.1.17__py3-none-any.whl → 0.1.19__py3-none-any.whl

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.

Potentially problematic release.


This version of jbqt might be problematic. Click here for more details.

jbqt/widgets/chips.py CHANGED
@@ -96,7 +96,7 @@ class ChipsWidget(IChipsWidget):
96
96
  input_layout = QHBoxLayout()
97
97
  self.input_field = QLineEdit(self)
98
98
  self.add_button = QPushButton("Add", self)
99
- self.add_button.clicked.connect(self.add_chip)
99
+ self.add_button.clicked.connect(self.parse_chip_input)
100
100
 
101
101
  self.clear_button = QPushButton(consts.ICONS.TRASH("darkred"), "", self)
102
102
  self.clear_button.clicked.connect(self.remove_all)
@@ -124,7 +124,7 @@ class ChipsWidget(IChipsWidget):
124
124
  if a1.type() == QEvent.Type.KeyPress and focus == self.input_field:
125
125
  match a1.key():
126
126
  case Qt.Key.Key_Return | Qt.Key.Key_Enter:
127
- self.add_chip()
127
+ self.parse_chip_input()
128
128
  return super().eventFilter(a0, a1)
129
129
 
130
130
  def get_unweight_chip(self, tag: str) -> str:
@@ -221,15 +221,23 @@ class ChipsWidget(IChipsWidget):
221
221
  def emit_changes(self):
222
222
  self.valuesChanged.emit(self.values)
223
223
 
224
+ def parse_chip_input(self) -> None:
225
+ text = self.input_field.text().strip()
226
+ if "," in text:
227
+ self.add_chips(utils.parse_csv_line(text))
228
+ else:
229
+ self.add_chip()
230
+ self.input_field.setText("")
231
+
224
232
  def add_chip(self):
225
233
  text = self.input_field.text().strip()
234
+
226
235
  if text and text not in self.values:
227
236
  chip_button = ChipButton(text, self.update_chip, self.remove_chip)
228
237
 
229
238
  self.chip_layout.addWidget(chip_button)
230
239
  self.values.append(text)
231
240
  self.emit_changes()
232
- self.input_field.setText("")
233
241
 
234
242
  def remove_chip(self, button: ChipButton): # type: ignore
235
243
  self.chip_layout.removeWidget(button)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: jbqt
3
- Version: 0.1.17
3
+ Version: 0.1.19
4
4
  Summary:
5
5
  Author: Joseph Bochinski
6
6
  Author-email: stirgejr@gmail.com
@@ -9,7 +9,7 @@ Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.12
10
10
  Requires-Dist: fuzzywuzzy (>=0.18.0,<0.19.0)
11
11
  Requires-Dist: jbconsts (>=0.1.1,<0.2.0)
12
- Requires-Dist: jbutils (>=0.1.24,<0.2.0)
12
+ Requires-Dist: jbutils (>=0.1.27,<0.2.0)
13
13
  Requires-Dist: pyqt6 (>=6.9.0,<7.0.0)
14
14
  Requires-Dist: python-levenshtein (>=0.27.1,<0.28.0)
15
15
  Requires-Dist: rich (>=14.0.0,<15.0.0)
@@ -18,11 +18,11 @@ jbqt/types/__init__.py,sha256=er6dhNIqsfQr8mdpA2f7LIvX2CPmRG2Xyqj0cneitpg,407
18
18
  jbqt/view_icons.py,sha256=Jy_o5dFSzKZGUX7oBq0sEi8jTrI5eI4COu5e4bWKT9o,6559
19
19
  jbqt/widgets/__init__.py,sha256=WxDWM5MDnB9NkvaYxE4AiT7tFjGB9fBirEx2iZUujeU,523
20
20
  jbqt/widgets/chip_button.py,sha256=mmh9EZfYY-d0hiQbGIZDvmi6RrBfKgGein_f_69gnCY,6362
21
- jbqt/widgets/chips.py,sha256=DH6Y1xr7vydq7dNOlETcXaOPy6rTu8IfrdUO8BAKjmg,8123
21
+ jbqt/widgets/chips.py,sha256=1FzRu5rbqR3FWpUeiWa3_hmzSJYtM94vfJlgo9aljp4,8345
22
22
  jbqt/widgets/multiselect.py,sha256=ucL6QeFHs12DnHAHASMwdOD9YFYu4x4NDCYa6Pl41HM,7328
23
23
  jbqt/widgets/simple.py,sha256=pj2PBdR1am7VtPi4jGxsKm5nOLyTwiZV4jCuTd58rpk,1841
24
24
  jbqt/widgets/toast.py,sha256=S85PgcydbmICnjSY5VR6KUG_UZv4UERjvE_mP_zE9GA,1179
25
25
  jbqt/widgets/widget_utils.py,sha256=IEVg60rJ6hL0_9wre7j-_aprg-fccNZhwwOtbVEmHvw,2525
26
- jbqt-0.1.17.dist-info/METADATA,sha256=CPidysbyPX4q5TYg6oreR8I6oaW0fbOpc1yt6tDRSo0,544
27
- jbqt-0.1.17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
28
- jbqt-0.1.17.dist-info/RECORD,,
26
+ jbqt-0.1.19.dist-info/METADATA,sha256=UV1YutPUAe-Rff3IAKKsakC65hJsGBiCedBasgBvDGE,544
27
+ jbqt-0.1.19.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
28
+ jbqt-0.1.19.dist-info/RECORD,,
File without changes