psychopy 2024.1.1__py3-none-any.whl → 2024.1.3__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.
- psychopy/__init__.py +2 -2
- psychopy/alerts/_alerts.py +6 -2
- psychopy/alerts/alertsCatalogue/alertmsg.py +15 -0
- psychopy/app/builder/dialogs/paramCtrls.py +4 -2
- psychopy/app/builder/localizedStrings.py +16 -4
- psychopy/app/locale/ar_001/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/cs_CZ/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/da_DK/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/de_DE/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/el_GR/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/en_NZ/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/en_US/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/es_ES/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/fa_IR/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/fi_FI/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/fr_FR/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/he_IL/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/hi_IN/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/hu_HU/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/it_IT/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ja_JP/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ja_JP/LC_MESSAGE/messages.po +3548 -5422
- psychopy/app/locale/ko_KR/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ms_MY/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/nl_NL/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/nn_NO/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/pl_PL/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/pt_PT/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ro_RO/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ru_RU/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/sv_SE/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/tr_TR/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/zh_CN/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/zh_TW/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/plugin_manager/plugins.py +1 -1
- psychopy/app/preferencesDlg.py +2 -1
- psychopy/demos/builder/Hardware/EEG_parallel_component/EEG_triggers_parallel_comp.psyexp +552 -550
- psychopy/demos/builder/Hardware/EEG_serial_component/EEG_triggers_serial_comp.psyexp +572 -570
- psychopy/demos/coder/timing/timeByFrames.py +7 -1
- psychopy/experiment/components/_base.py +122 -0
- psychopy/experiment/components/aperture/__init__.py +6 -2
- psychopy/experiment/components/brush/__init__.py +3 -1
- psychopy/experiment/components/button/__init__.py +6 -2
- psychopy/experiment/components/buttonBox/__init__.py +2 -1
- psychopy/experiment/components/camera/__init__.py +13 -0
- psychopy/experiment/components/code/__init__.py +34 -1
- psychopy/experiment/components/form/formItems.xltx +0 -0
- psychopy/experiment/components/mouse/__init__.py +12 -0
- psychopy/experiment/components/polygon/__init__.py +14 -3
- psychopy/experiment/components/settings/__init__.py +4 -1
- psychopy/experiment/components/sound/__init__.py +1 -1
- psychopy/experiment/components/text/__init__.py +1 -1
- psychopy/experiment/params.py +17 -0
- psychopy/experiment/routines/_base.py +122 -0
- psychopy/experiment/routines/counterbalance/__init__.py +1 -1
- psychopy/hardware/button.py +4 -3
- psychopy/hardware/camera/__init__.py +6 -0
- psychopy/hardware/keyboard.py +8 -3
- psychopy/iohub/devices/eyetracker/hw/gazepoint/__init__.py +1 -1
- psychopy/iohub/devices/eyetracker/hw/gazepoint/gp3/__init__.py +1 -1
- psychopy/iohub/devices/eyetracker/hw/gazepoint/gp3/calibration.py +1 -1
- psychopy/iohub/devices/eyetracker/hw/gazepoint/gp3/eyetracker.py +1 -1
- psychopy/localization/generateTranslationTemplate.py +45 -19
- psychopy/localization/messages.pot +5049 -3418
- psychopy/preferences/Darwin.spec +2 -0
- psychopy/preferences/FreeBSD.spec +2 -0
- psychopy/preferences/Linux.spec +2 -0
- psychopy/preferences/Windows.spec +2 -0
- psychopy/preferences/baseNoArch.spec +2 -0
- psychopy/preferences/generateHints.py +2 -1
- psychopy/preferences/hints.py +118 -97
- psychopy/tests/test_experiment/test_components/__init__.py +1 -1
- psychopy/tests/test_experiment/test_components/{test_ButtonBox.py → test_ButtonBoxComponent.py} +9 -27
- psychopy/tests/test_experiment/test_components/{test_Code.py → test_CodeComponent.py} +8 -20
- psychopy/tests/test_experiment/test_components/test_GratingComponent.py +7 -0
- psychopy/tests/test_experiment/test_components/test_ImageComponent.py +8 -0
- psychopy/tests/test_experiment/test_components/{test_Mouse.py → test_MouseComponent.py} +44 -57
- psychopy/tests/test_experiment/test_components/{test_Polygon.py → test_PolygonComponent.py} +9 -25
- psychopy/tests/test_experiment/test_components/{test_ResourceManager.py → test_ResourceManagerComponent.py} +3 -13
- psychopy/tests/test_experiment/test_components/{test_Settings.py → test_SettingsComponent.py} +1 -3
- psychopy/tests/test_experiment/test_components/{test_Static.py → test_StaticComponent.py} +3 -12
- psychopy/tests/test_experiment/test_components/test_all_components.py +8 -66
- psychopy/tests/test_experiment/test_components/test_base_components.py +212 -125
- psychopy/tools/fontmanager.py +1 -1
- psychopy/tools/versionchooser.py +1 -1
- psychopy/visual/noise.py +9 -0
- psychopy/visual/radial.py +8 -0
- psychopy/visual/secondorder.py +9 -0
- psychopy/visual/textbox2/textbox2.py +19 -21
- {psychopy-2024.1.1.dist-info → psychopy-2024.1.3.dist-info}/METADATA +1 -1
- {psychopy-2024.1.1.dist-info → psychopy-2024.1.3.dist-info}/RECORD +95 -66
- {psychopy-2024.1.1.dist-info → psychopy-2024.1.3.dist-info}/WHEEL +1 -1
- psychopy/tests/test_experiment/test_components/test_Image.py +0 -24
- {psychopy-2024.1.1.dist-info → psychopy-2024.1.3.dist-info}/entry_points.txt +0 -0
- {psychopy-2024.1.1.dist-info → psychopy-2024.1.3.dist-info}/licenses/AUTHORS.md +0 -0
- {psychopy-2024.1.1.dist-info → psychopy-2024.1.3.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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
77
|
-
if not
|
|
78
|
-
untranslated_new.append(
|
|
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
|
-
|
|
103
|
+
po_message_ids = []
|
|
90
104
|
n_untranslated = 0
|
|
91
105
|
locale_identifier = os.path.basename(os.path.dirname(root))
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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'
|