boris-behav-obs 8.26__py2.py3-none-any.whl → 8.26.1__py2.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.
boris/select_modifiers.py CHANGED
@@ -43,6 +43,10 @@ from . import utilities as util
43
43
 
44
44
 
45
45
  class ModifiersList(QDialog):
46
+ """
47
+ class for selection the modifier(s)
48
+ """
49
+
46
50
  def __init__(self, code: str, modifiers_dict: dict, currentModifier: str):
47
51
  super().__init__()
48
52
  self.setWindowTitle(cfg.programName)
@@ -60,11 +64,11 @@ class ModifiersList(QDialog):
60
64
  self.modifiersSetNumber = 0
61
65
 
62
66
  for idx in util.sorted_keys(modifiers_dict):
63
- if self.modifiers_dict[idx]["type"] not in [
67
+ if self.modifiers_dict[idx]["type"] not in (
64
68
  cfg.SINGLE_SELECTION,
65
69
  cfg.MULTI_SELECTION,
66
70
  cfg.NUMERIC_MODIFIER,
67
- ]:
71
+ ):
68
72
  continue
69
73
 
70
74
  V2layout = QVBoxLayout()
@@ -75,10 +79,13 @@ class ModifiersList(QDialog):
75
79
  lb.setText(f"Modifier <b>{self.modifiers_dict[idx]['name']}</b>")
76
80
  V2layout.addWidget(lb)
77
81
 
78
- if self.modifiers_dict[idx]["type"] in [
82
+ lb = QLabel(f"<small>{self.modifiers_dict[idx]['description']}</small>")
83
+ V2layout.addWidget(lb)
84
+
85
+ if self.modifiers_dict[idx]["type"] in (
79
86
  cfg.SINGLE_SELECTION,
80
87
  cfg.MULTI_SELECTION,
81
- ]:
88
+ ):
82
89
  lw = QListWidget()
83
90
  self.modifiers_dict[idx]["widget"] = lw
84
91
  lw.setObjectName(f"lw_modifiers_({self.modifiers_dict[idx]['type']})")
@@ -114,6 +121,7 @@ class ModifiersList(QDialog):
114
121
  if self.modifiers_dict[idx]["type"] in [cfg.NUMERIC_MODIFIER]:
115
122
  le = QLineEdit()
116
123
  self.modifiers_dict[idx]["widget"] = le
124
+ le.setObjectName(f"le_modifiers_({self.modifiers_dict[idx]['type']})")
117
125
 
118
126
  if currentModifierList != [""] and currentModifierList[int(idx)] != "None":
119
127
  le.setText(currentModifierList[int(idx)])
@@ -160,10 +168,14 @@ class ModifiersList(QDialog):
160
168
 
161
169
  # accept and close dialog if enter pressed
162
170
  if ek == Qt.Key_Enter or ek == Qt.Key_Return: # enter or enter from numeric pad
163
- self.accept()
171
+ if not self.pbOK_clicked():
172
+ return False
164
173
  return True
165
174
 
175
+ modifiersSetIndex = 0
166
176
  for widget in self.children():
177
+ if "_modifiers" in widget.objectName():
178
+ modifiersSetIndex = modifiersSetIndex + 1
167
179
  if "lw_modifiers" in widget.objectName():
168
180
  if self.modifiersSetNumber == 1:
169
181
  # check if modifiers have code
@@ -172,7 +184,7 @@ class ModifiersList(QDialog):
172
184
  break
173
185
  else:
174
186
  # modifiers have no associated code: the modifier starting with hit key will be selected
175
- if ek not in [Qt.Key_Down, Qt.Key_Up]:
187
+ if ek not in (Qt.Key_Down, Qt.Key_Up):
176
188
  if ek == Qt.Key_Space and f"({cfg.MULTI_SELECTION})" in widget.objectName(): # checking using SPACE bar
177
189
  if widget.item(widget.currentRow()).checkState() == Qt.Checked:
178
190
  widget.item(widget.currentRow()).setCheckState(Qt.Unchecked)
@@ -198,6 +210,7 @@ class ModifiersList(QDialog):
198
210
  return
199
211
 
200
212
  for index in range(widget.count()):
213
+ # check function kesy (F1, F2...)
201
214
  if ek in cfg.function_keys:
202
215
  if f"({cfg.function_keys[ek]})" in widget.item(index).text().upper():
203
216
  if f"({cfg.SINGLE_SELECTION})" in widget.objectName():
@@ -206,6 +219,10 @@ class ModifiersList(QDialog):
206
219
  if self.modifiersSetNumber == 1:
207
220
  self.accept()
208
221
  return True
222
+ # else move to next set of mofifiers
223
+ elif modifiersSetIndex != self.modifiersSetNumber:
224
+ widget.parent().focusNextChild()
225
+ return True
209
226
 
210
227
  if f"({cfg.MULTI_SELECTION})" in widget.objectName():
211
228
  if widget.item(index).checkState() == Qt.Checked:
@@ -220,6 +237,10 @@ class ModifiersList(QDialog):
220
237
  if self.modifiersSetNumber == 1:
221
238
  self.accept()
222
239
  return True
240
+ # else move to next set of mofifiers
241
+ elif modifiersSetIndex != self.modifiersSetNumber:
242
+ widget.parent().focusNextChild()
243
+ return True
223
244
 
224
245
  if f"({cfg.MULTI_SELECTION})" in widget.objectName():
225
246
  if widget.item(index).checkState() == Qt.Checked:
@@ -271,6 +292,9 @@ class ModifiersList(QDialog):
271
292
  return self.modifiers_dict
272
293
 
273
294
  def pbOK_clicked(self):
295
+ """
296
+ OK button is clicked
297
+ """
274
298
  for idx in util.sorted_keys(self.modifiers_dict):
275
299
  if self.modifiers_dict[idx]["type"] == cfg.NUMERIC_MODIFIER:
276
300
  if self.modifiers_dict[idx]["widget"].text():
@@ -280,8 +304,8 @@ class ModifiersList(QDialog):
280
304
  QMessageBox.warning(
281
305
  self,
282
306
  cfg.programName,
283
- "<b>{}</b> is not a numeric value".format(self.modifiers_dict[idx]["widget"].text()),
307
+ f"<b>{self.modifiers_dict[idx]['widget'].text()}</b> is not a numeric value",
284
308
  )
285
- return
309
+ return False
286
310
 
287
311
  self.accept()
boris/version.py CHANGED
@@ -20,5 +20,5 @@ This file is part of BORIS.
20
20
 
21
21
  """
22
22
 
23
- __version__ = "8.26"
24
- __version_date__ = "2024-06-04"
23
+ __version__ = "8.26.1"
24
+ __version_date__ = "2024-06-06"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boris-behav-obs
3
- Version: 8.26
3
+ Version: 8.26.1
4
4
  Summary: BORIS - Behavioral Observation Research Interactive Software
5
5
  Author-email: Olivier Friard <olivier.friard@unito.it>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -66,7 +66,7 @@ boris/project_import_export.py,sha256=lCL4fOZuG5MaEf_wfDSHiE7-M2ZQsIbUR7KpHZjb1U
66
66
  boris/project_ui.py,sha256=TRJlsqq4XbIl8k2f20BKr2PtKa0QNjFNr6UnMieZYqU,35915
67
67
  boris/qrc_boris.py,sha256=4U2cD_fIBTtsTPhirOl9I3kTArOhXWYvfuO_A0M9N0I,675001
68
68
  boris/qrc_boris5.py,sha256=6bwT8OVtIr84nVIYp2ldUL7XL6WJi9zgJow6kgRxuIQ,161601
69
- boris/select_modifiers.py,sha256=jbzXKTuAuWnIVsykAuzlQmTqkAcmQsJl7c3cJiPbw_w,12051
69
+ boris/select_modifiers.py,sha256=TAo7xi5bhiMp9WOAwEPq9xc8i4Nsa2QrcpoCrUgPwhE,13178
70
70
  boris/select_observations.py,sha256=snMC23nYD_qi88q95rXqV-NqbGO5BrLrC-CKlmVR3ok,14441
71
71
  boris/select_subj_behav.py,sha256=bX-YCeysK5QowYgoxQyy-9qeZmhzWM4SwArXxSAa5ho,10342
72
72
  boris/state_events.py,sha256=AcZmD0pIJ4AszTQe9conWlh8gJhwdBjZiGm1KOXt804,7768
@@ -76,7 +76,7 @@ boris/time_budget_functions.py,sha256=L-0PuPWYR33UMfqmxpcCVH-w4mLLrtZ8b8kBTmBwls
76
76
  boris/time_budget_widget.py,sha256=9WV-iKYSl1f3HBrGcL-eHDjUswrFQh6-WUcffTtce1Y,42852
77
77
  boris/transitions.py,sha256=2zucdoa2jTpWtM6nWHr8lOvjXkrQmo9j71fz_fMLALU,11998
78
78
  boris/utilities.py,sha256=07qXAQ6aGyiSC2h6RMJ031OlXYy05-KTLJtnQtXn6FU,48724
79
- boris/version.py,sha256=SiBJBuTJeNtnGUhsWns3oikAq4V1gYNKHndPqWMiojY,786
79
+ boris/version.py,sha256=p1Eo1rAKt4WoBUXddzmCG41ZVzlVjIetATyhD0XQVaI,788
80
80
  boris/video_equalizer.py,sha256=QpVgmdqX_E4HnMa2f_Qo_fKJTl9nBoTQd_ykv9RWlIQ,5862
81
81
  boris/video_equalizer_ui.py,sha256=A2_Sz9AAVnJygTRUeK_YXxf-WWQpxSSlFw0MjkxiwSg,9762
82
82
  boris/video_operations.py,sha256=96jR-3snNn9VeEURRD6rCwvOL2sSHXoqlP_gYFwgO8A,9379
@@ -105,9 +105,9 @@ boris/qdarkstyle/utils/__init__.py,sha256=Nlma8-zbHoJc5n2NVT7OvwxPG5765JnsmMeGzr
105
105
  boris/qdarkstyle/utils/__main__.py,sha256=J1biUyDzfutKU1n9NdH9WnD0gFHaF-OJA4Q-n6Q2ehs,3309
106
106
  boris/qdarkstyle/utils/images.py,sha256=af-BJllzWgVoVz6QMvhFcKqvF3mo44AThaBjuAuHtNE,14444
107
107
  boris/qdarkstyle/utils/scss.py,sha256=n7WNo6pPRft8-dU7_gfjB_jA-JZAy50-S792RwR7Ri0,9366
108
- boris_behav_obs-8.26.dist-info/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
109
- boris_behav_obs-8.26.dist-info/METADATA,sha256=nDb9oLy7TwmQToZgmmA3QqO4oPP9gIQE3AxfETicOC0,45541
110
- boris_behav_obs-8.26.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
111
- boris_behav_obs-8.26.dist-info/entry_points.txt,sha256=fuO7JxKFLOm6xp6m3JHRA1UO_QW1dYU-F0IooA1NqQs,37
112
- boris_behav_obs-8.26.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
113
- boris_behav_obs-8.26.dist-info/RECORD,,
108
+ boris_behav_obs-8.26.1.dist-info/LICENSE.TXT,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
109
+ boris_behav_obs-8.26.1.dist-info/METADATA,sha256=38_OR718pDduPAAmZi8ixtl_iH1zyPE4T38USEQALBY,45543
110
+ boris_behav_obs-8.26.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
111
+ boris_behav_obs-8.26.1.dist-info/entry_points.txt,sha256=fuO7JxKFLOm6xp6m3JHRA1UO_QW1dYU-F0IooA1NqQs,37
112
+ boris_behav_obs-8.26.1.dist-info/top_level.txt,sha256=fJSgm62S7WesiwTorGbOO4nNN0yzgZ3klgfGi3Px4qI,6
113
+ boris_behav_obs-8.26.1.dist-info/RECORD,,