psychopy 2024.1.0__py3-none-any.whl → 2024.1.2__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 psychopy might be problematic. Click here for more details.

Files changed (57) hide show
  1. psychopy/__init__.py +2 -2
  2. psychopy/alerts/_alerts.py +6 -2
  3. psychopy/alerts/alertsCatalogue/alertmsg.py +15 -0
  4. psychopy/app/builder/builder.py +3 -0
  5. psychopy/app/builder/dialogs/paramCtrls.py +4 -2
  6. psychopy/app/builder/localizedStrings.py +16 -4
  7. psychopy/app/locale/ja_JP/LC_MESSAGE/messages.mo +0 -0
  8. psychopy/app/locale/ja_JP/LC_MESSAGE/messages.po +3548 -5422
  9. psychopy/app/plugin_manager/plugins.py +80 -57
  10. psychopy/app/preferencesDlg.py +2 -1
  11. psychopy/app/utils.py +2 -2
  12. psychopy/demos/builder/Hardware/EEG_parallel_component/EEG_triggers_parallel_comp.psyexp +552 -550
  13. psychopy/demos/builder/Hardware/EEG_serial_component/EEG_triggers_serial_comp.psyexp +572 -570
  14. psychopy/demos/coder/timing/timeByFrames.py +7 -1
  15. psychopy/experiment/components/_base.py +122 -0
  16. psychopy/experiment/components/aperture/__init__.py +6 -2
  17. psychopy/experiment/components/brush/__init__.py +3 -1
  18. psychopy/experiment/components/button/__init__.py +6 -2
  19. psychopy/experiment/components/buttonBox/__init__.py +2 -1
  20. psychopy/experiment/components/camera/__init__.py +13 -0
  21. psychopy/experiment/components/code/__init__.py +34 -1
  22. psychopy/experiment/components/form/formItems.xltx +0 -0
  23. psychopy/experiment/components/polygon/__init__.py +14 -3
  24. psychopy/experiment/components/settings/__init__.py +4 -1
  25. psychopy/experiment/components/sound/__init__.py +1 -1
  26. psychopy/experiment/components/text/__init__.py +1 -1
  27. psychopy/experiment/params.py +17 -0
  28. psychopy/experiment/routines/_base.py +122 -0
  29. psychopy/experiment/routines/counterbalance/__init__.py +1 -1
  30. psychopy/hardware/button.py +4 -3
  31. psychopy/hardware/camera/__init__.py +6 -0
  32. psychopy/hardware/keyboard.py +7 -2
  33. psychopy/iohub/devices/eyetracker/hw/gazepoint/__init__.py +1 -1
  34. psychopy/iohub/devices/eyetracker/hw/gazepoint/gp3/__init__.py +1 -1
  35. psychopy/iohub/devices/eyetracker/hw/gazepoint/gp3/calibration.py +1 -1
  36. psychopy/iohub/devices/eyetracker/hw/gazepoint/gp3/eyetracker.py +1 -1
  37. psychopy/localization/generateTranslationTemplate.py +45 -19
  38. psychopy/localization/messages.pot +5049 -3418
  39. psychopy/preferences/Darwin.spec +2 -0
  40. psychopy/preferences/FreeBSD.spec +2 -0
  41. psychopy/preferences/Linux.spec +2 -0
  42. psychopy/preferences/Windows.spec +2 -0
  43. psychopy/preferences/baseNoArch.spec +2 -0
  44. psychopy/preferences/generateHints.py +2 -1
  45. psychopy/preferences/hints.py +118 -97
  46. psychopy/tools/fontmanager.py +1 -1
  47. psychopy/tools/versionchooser.py +1 -1
  48. psychopy/visual/noise.py +9 -0
  49. psychopy/visual/radial.py +8 -0
  50. psychopy/visual/secondorder.py +9 -0
  51. psychopy/visual/textbox2/textbox2.py +19 -21
  52. {psychopy-2024.1.0.dist-info → psychopy-2024.1.2.dist-info}/METADATA +2 -2
  53. {psychopy-2024.1.0.dist-info → psychopy-2024.1.2.dist-info}/RECORD +57 -57
  54. {psychopy-2024.1.0.dist-info → psychopy-2024.1.2.dist-info}/WHEEL +1 -1
  55. {psychopy-2024.1.0.dist-info → psychopy-2024.1.2.dist-info}/entry_points.txt +0 -0
  56. {psychopy-2024.1.0.dist-info → psychopy-2024.1.2.dist-info}/licenses/AUTHORS.md +0 -0
  57. {psychopy-2024.1.0.dist-info → psychopy-2024.1.2.dist-info}/licenses/LICENSE +0 -0
@@ -23,21 +23,26 @@ from psychopy import __version__ as psychopy_version
23
23
  # commandline argument
24
24
  #
25
25
 
26
- parser = argparse.ArgumentParser(description='usage: foo.py [-h] [-c]')
26
+ parser = argparse.ArgumentParser(description='usage: generateTranslationTemplate.py [-h] [-c]')
27
27
  parser.add_argument('-c', '--commit', action='store_true', help='Commit messages.pot if updated.', required=False)
28
28
 
29
29
  command_args = parser.parse_args()
30
30
 
31
31
  #
32
- # hints.py must be updated to find new hints
32
+ # hints.py must be updated to find new hints and alarts
33
33
  #
34
34
 
35
+ print('Generate hints.py... ', end='')
35
36
  subprocess.call(['python', 'generateHints.py'], cwd='../preferences')
37
+ print('Done.\nGenerate alartmsg.py... ', end='')
38
+ subprocess.call(['python', 'generateAlertmsg.py'], cwd='../alerts/alertsCatalogue')
39
+ print('Done.')
36
40
 
37
41
  #
38
42
  # Extracting messages and generating new template file
39
43
  #
40
44
 
45
+ print('Generating new template file... ', end='')
41
46
  new_pot_filename = 'messages_new.pot'
42
47
  current_pot_filename = 'messages.pot'
43
48
 
@@ -51,18 +56,22 @@ argv = ['pybabel', '-q', 'extract',
51
56
  babel_frontend = babel.messages.frontend.CommandLineInterface()
52
57
  babel_frontend.run(argv)
53
58
 
59
+ print('Done.')
60
+
54
61
  #
55
62
  # Comparing new and current pot file.
56
63
  #
57
64
 
58
- new_pot_messages = []
65
+ print('Maing a list of message IDs in the new template... ', end='')
66
+
67
+ new_pot_message_ids = []
59
68
  current_pot_id = []
60
69
  untranslated_new = []
61
70
 
62
71
  with codecs.open(new_pot_filename, 'r', 'utf-8') as fp:
63
72
  for message in babel.messages.pofile.read_po(fp):
64
73
  if message.id:
65
- new_pot_messages.append(message)
74
+ new_pot_message_ids.append(message.id)
66
75
 
67
76
  if not os.path.exists(current_pot_filename):
68
77
  # if current pot file doesn't exist, copy it from new pot file.
@@ -73,33 +82,50 @@ with codecs.open(current_pot_filename, 'r', 'utf-8') as fp:
73
82
  if message.id:
74
83
  current_pot_id.append(message.id)
75
84
 
76
- for message in new_pot_messages:
77
- if not message.id in current_pot_id:
78
- untranslated_new.append(message)
85
+ for id in new_pot_message_ids:
86
+ if id not in current_pot_id:
87
+ untranslated_new.append(id)
88
+
79
89
 
90
+ print('Done.')
80
91
 
81
92
  #
82
93
  # Output summary
83
94
  #
95
+
96
+ print('Checking current PO files...')
97
+
84
98
  n_untranslated_locale = []
85
99
 
86
100
  for root, dirs, files in os.walk('../app/locale/'):
87
101
  for file in files:
88
102
  if file=='messages.po':
89
- po_message_id = []
103
+ po_message_ids = []
90
104
  n_untranslated = 0
91
105
  locale_identifier = os.path.basename(os.path.dirname(root))
92
- with codecs.open(os.path.join(root, file), 'r', 'utf-8') as fp:
93
- catalog = babel.messages.pofile.read_po(fp)
94
- for message in catalog:
95
- if message.id:
96
- po_message_id.append(message.id)
97
- for message in new_pot_messages:
98
- if not message.id in po_message_id:
99
- n_untranslated += 1
100
- n_untranslated_locale.append((locale_identifier, n_untranslated))
101
-
102
- n_messages = len(new_pot_messages)
106
+ print('{}: '.format(locale_identifier), end='')
107
+ try:
108
+ with codecs.open(os.path.join(root, file), 'r', 'utf-8') as fp:
109
+ catalog = babel.messages.pofile.read_po(fp)
110
+ for message in catalog:
111
+ if message.id:
112
+ po_message_ids.append(message.id)
113
+ # found in the new POT, but not translated
114
+ if message.id in new_pot_message_ids and message.string == '':
115
+ n_untranslated += 1
116
+ for id in new_pot_message_ids:
117
+ # not found in the current PO (it must be untranslated)
118
+ if id not in po_message_ids:
119
+ n_untranslated += 1
120
+ n_untranslated_locale.append((locale_identifier, n_untranslated))
121
+ except ValueError:
122
+ # If date strings in PO file is wrong (e.g. empty string),
123
+ # read_po() raises ValueError.
124
+ print('Skip.')
125
+ else:
126
+ print('Ok.')
127
+
128
+ n_messages = len(new_pot_message_ids)
103
129
  summary_message = '\nNumber of messages in *.py files: {}\n'.format(n_messages)
104
130
  summary_message += 'New message(s): {}\n\n'.format(len(untranslated_new))
105
131
  summary_message += 'Untranslated message(s)\n'