psychopy 2024.1.4__py3-none-any.whl → 2024.2.0__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/.DS_Store +0 -0
- psychopy/CHANGELOG.txt +206 -0
- psychopy/GIT_SHA +1 -0
- psychopy/VERSION +1 -0
- psychopy/__init__.py +77 -15
- psychopy/app/Resources/classic/plugin16.png +0 -0
- psychopy/app/Resources/classic/plugin16@2x.png +0 -0
- psychopy/app/Resources/dark/plugin16.png +0 -0
- psychopy/app/Resources/dark/plugin16@2x.png +0 -0
- psychopy/app/Resources/light/plugin16.png +0 -0
- psychopy/app/Resources/light/plugin16@2x.png +0 -0
- psychopy/app/__init__.py +76 -2
- psychopy/app/_psychopyApp.py +126 -101
- psychopy/app/builder/builder.py +14 -10
- psychopy/app/builder/dialogs/__init__.py +8 -8
- psychopy/app/builder/dialogs/dlgsConditions.py +12 -13
- psychopy/app/builder/dialogs/paramCtrls.py +24 -57
- psychopy/app/builder/validators.py +2 -2
- psychopy/app/coder/codeEditorBase.py +8 -8
- psychopy/app/coder/coder.py +4 -4
- psychopy/app/connections/sendusage.py +2 -2
- psychopy/app/connections/updates.py +9 -9
- psychopy/app/dialogs.py +34 -2
- psychopy/app/idle.py +31 -0
- psychopy/app/jobs.py +21 -3
- psychopy/app/linuxconfig/__init__.py +9 -0
- psychopy/app/locale/ar_001/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ar_001/LC_MESSAGE/messages.po +4602 -2540
- psychopy/app/locale/es_CO/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/es_CO/LC_MESSAGE/messages.po +56 -54
- psychopy/app/locale/es_ES/LC_MESSAGE/messages.po +53 -43
- psychopy/app/locale/es_US/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/es_US/LC_MESSAGE/messages.po +56 -54
- psychopy/app/locale/ja_JP/LC_MESSAGE/messages.mo +0 -0
- psychopy/app/locale/ja_JP/LC_MESSAGE/messages.po +1011 -942
- psychopy/app/locale/pt_PT/LC_MESSAGE/messages.po +9415 -5
- psychopy/app/pavlovia_ui/_base.py +33 -3
- psychopy/app/pavlovia_ui/search.py +0 -1
- psychopy/app/plugin_manager/dialog.py +104 -51
- psychopy/app/plugin_manager/packages.py +5 -0
- psychopy/app/plugin_manager/plugins.py +145 -67
- psychopy/app/preferencesDlg.py +8 -8
- psychopy/app/psychopyApp.py +11 -5
- psychopy/app/ribbon.py +124 -14
- psychopy/app/runner/runner.py +6 -1
- psychopy/app/stdout/stdOutRich.py +27 -11
- psychopy/app/themes/icons.py +52 -2
- psychopy/assets/__init__.py +0 -0
- psychopy/assets/click.png +0 -0
- psychopy/assets/clicknext.png +0 -0
- psychopy/assets/next.png +0 -0
- psychopy/assets/psychopy.ico +0 -0
- psychopy/assets/psychopy.png +0 -0
- psychopy/assets/templates/__init__.py +0 -0
- psychopy/assets/touch.png +0 -0
- psychopy/assets/touchnext.png +0 -0
- psychopy/assets/window.ico +0 -0
- psychopy/changes/2023.1.0.md +9 -0
- psychopy/changes/2024.1.0.md +16 -0
- psychopy/changes/__init__.py +0 -0
- psychopy/clock.py +2 -2
- psychopy/colors.py +2 -1
- psychopy/compatibility.py +53 -1
- psychopy/contrib/.DS_Store +0 -0
- psychopy/contrib/configobj/__init__.py +10 -8
- psychopy/data/__init__.py +3 -2
- psychopy/data/base.py +5 -5
- psychopy/data/experiment.py +130 -4
- psychopy/data/routine.py +56 -0
- psychopy/data/staircase.py +2 -2
- psychopy/data/trial.py +559 -97
- psychopy/data/utils.py +56 -21
- psychopy/demos/.DS_Store +0 -0
- psychopy/demos/builder/.DS_Store +0 -0
- psychopy/demos/builder/Design Templates/.DS_Store +0 -0
- psychopy/demos/builder/Experiments/.DS_Store +0 -0
- psychopy/demos/builder/Feature Demos/.DS_Store +0 -0
- psychopy/demos/builder/Feature Demos/buttonBox/buttonBoxDemo.psyexp +375 -0
- psychopy/demos/builder/Feature Demos/buttonBox/readme.md +5 -0
- psychopy/demos/builder/Feature Demos/pilotMode/pilotMode.psyexp +433 -0
- psychopy/demos/builder/Feature Demos/pilotMode/readme.md +7 -0
- psychopy/demos/builder/Hardware/.DS_Store +0 -0
- psychopy/demos/builder/Helper Tools/.DS_Store +0 -0
- psychopy/demos/coder/.DS_Store +0 -0
- psychopy/demos/coder/hardware/testSoundLatency.py +2 -2
- psychopy/demos/coder/iohub/.DS_Store +0 -0
- psychopy/demos/coder/misc/hdf5_2_csv +33 -0
- psychopy/event.py +30 -29
- psychopy/experiment/.DS_Store +0 -0
- psychopy/experiment/_experiment.py +6 -6
- psychopy/experiment/components/.DS_Store +0 -0
- psychopy/experiment/components/__init__.py +6 -3
- psychopy/experiment/components/_base.py +286 -131
- psychopy/experiment/components/aperture/.DS_Store +0 -0
- psychopy/experiment/components/brush/.DS_Store +0 -0
- psychopy/experiment/components/button/.DS_Store +0 -0
- psychopy/experiment/components/button/__init__.py +5 -1
- psychopy/experiment/components/buttonBox/.DS_Store +0 -0
- psychopy/experiment/components/camera/.DS_Store +0 -0
- psychopy/experiment/components/code/.DS_Store +0 -0
- psychopy/experiment/components/dots/.DS_Store +0 -0
- psychopy/experiment/components/eyetracker_record/.DS_Store +0 -0
- psychopy/experiment/components/eyetracker_record/__init__.py +92 -30
- psychopy/experiment/components/form/.DS_Store +0 -0
- psychopy/experiment/components/form/__init__.py +6 -2
- psychopy/experiment/components/grating/.DS_Store +0 -0
- psychopy/experiment/components/grating/__init__.py +14 -3
- psychopy/experiment/components/image/.DS_Store +0 -0
- psychopy/experiment/components/image/__init__.py +14 -3
- psychopy/experiment/components/joyButtons/.DS_Store +0 -0
- psychopy/experiment/components/joystick/.DS_Store +0 -0
- psychopy/experiment/components/keyboard/.DS_Store +0 -0
- psychopy/experiment/components/keyboard/__init__.py +22 -10
- psychopy/experiment/components/microphone/.DS_Store +0 -0
- psychopy/experiment/components/microphone/__init__.py +59 -39
- psychopy/experiment/components/mouse/.DS_Store +0 -0
- psychopy/experiment/components/mouse/__init__.py +44 -29
- psychopy/experiment/components/movie/.DS_Store +0 -0
- psychopy/experiment/components/movie/__init__.py +1 -1
- psychopy/experiment/components/panorama/.DS_Store +0 -0
- psychopy/experiment/components/parallelOut/.DS_Store +0 -0
- psychopy/experiment/components/patch/.DS_Store +0 -0
- psychopy/experiment/components/polygon/.DS_Store +0 -0
- psychopy/experiment/components/polygon/__init__.py +26 -6
- psychopy/experiment/components/progress/.DS_Store +0 -0
- psychopy/experiment/components/ratingScale/.DS_Store +0 -0
- psychopy/experiment/components/resourceManager/.DS_Store +0 -0
- psychopy/experiment/components/roi/.DS_Store +0 -0
- psychopy/experiment/components/roi/__init__.py +5 -0
- psychopy/experiment/components/routineSettings/.DS_Store +0 -0
- psychopy/experiment/components/routineSettings/__init__.py +57 -10
- psychopy/experiment/components/serialOut/.DS_Store +0 -0
- psychopy/experiment/components/settings/.DS_Store +0 -0
- psychopy/experiment/components/settings/__init__.py +117 -42
- psychopy/experiment/components/slider/.DS_Store +0 -0
- psychopy/experiment/components/sound/.DS_Store +0 -0
- psychopy/experiment/components/sound/__init__.py +54 -19
- psychopy/experiment/components/static/.DS_Store +0 -0
- psychopy/experiment/components/static/__init__.py +1 -1
- psychopy/experiment/components/text/.DS_Store +0 -0
- psychopy/experiment/components/text/__init__.py +28 -3
- psychopy/experiment/components/textbox/.DS_Store +0 -0
- psychopy/experiment/components/textbox/__init__.py +12 -2
- psychopy/experiment/components/unknown/.DS_Store +0 -0
- psychopy/experiment/components/unknown/__init__.py +1 -2
- psychopy/experiment/components/unknownPlugin/.DS_Store +0 -0
- psychopy/experiment/components/unknownPlugin/__init__.py +2 -2
- psychopy/experiment/components/variable/.DS_Store +0 -0
- psychopy/experiment/flow.py +11 -4
- psychopy/experiment/loops.py +85 -37
- psychopy/experiment/params.py +74 -32
- psychopy/experiment/py2js_transpiler.py +8 -1
- psychopy/experiment/routines/.DS_Store +0 -0
- psychopy/experiment/routines/_base.py +102 -22
- psychopy/experiment/routines/counterbalance/.DS_Store +0 -0
- psychopy/experiment/routines/counterbalance/__init__.py +5 -1
- psychopy/experiment/routines/eyetracker_calibrate/.DS_Store +0 -0
- psychopy/experiment/routines/eyetracker_validate/.DS_Store +0 -0
- psychopy/experiment/routines/pavlovia_survey/.DS_Store +0 -0
- psychopy/experiment/routines/photodiodeValidator/.DS_Store +0 -0
- psychopy/experiment/routines/photodiodeValidator/__init__.py +6 -5
- psychopy/experiment/routines/unknown/.DS_Store +0 -0
- psychopy/gui/wxgui.py +4 -4
- psychopy/hardware/.DS_Store +0 -0
- psychopy/hardware/__init__.py +1 -1
- psychopy/hardware/base.py +12 -0
- psychopy/hardware/camera/__init__.py +1 -15
- psychopy/hardware/cedrus.py +10 -11
- psychopy/hardware/crs/colorcal.py +13 -22
- psychopy/hardware/crs/optical.py +10 -20
- psychopy/hardware/emulator.py +17 -14
- psychopy/hardware/eyetracker.py +42 -118
- psychopy/hardware/gammasci.py +4 -15
- psychopy/hardware/keyboard.py +102 -10
- psychopy/hardware/listener.py +3 -0
- psychopy/hardware/microphone.py +148 -18
- psychopy/hardware/minolta.py +8 -15
- psychopy/hardware/photodiode.py +191 -16
- psychopy/hardware/photometer/__init__.py +11 -19
- psychopy/hardware/pr.py +8 -15
- psychopy/hardware/speaker.py +39 -4
- psychopy/info.py +0 -71
- psychopy/iohub/.DS_Store +0 -0
- psychopy/iohub/__init__.py +1 -1
- psychopy/iohub/client/__init__.py +30 -20
- psychopy/iohub/client/keyboard.py +24 -24
- psychopy/iohub/datastore/__init__.py +2 -2
- psychopy/iohub/datastore/util.py +2 -2
- psychopy/iohub/default_config.yaml +1 -1
- psychopy/iohub/devices/.DS_Store +0 -0
- psychopy/iohub/devices/__init__.py +112 -25
- psychopy/iohub/devices/deviceConfigValidation.py +2 -1
- psychopy/iohub/devices/experiment/default_experiment.yaml +12 -1
- psychopy/iohub/devices/experiment/supported_config_settings.yaml +5 -1
- psychopy/iohub/devices/eyetracker/.DS_Store +0 -0
- psychopy/iohub/devices/eyetracker/__init__.py +46 -0
- psychopy/iohub/devices/eyetracker/calibration/procedure.py +2 -2
- psychopy/iohub/devices/eyetracker/hw/gazepoint/__init__.py +14 -2
- psychopy/iohub/devices/eyetracker/hw/mouse/eyetracker.py +3 -4
- psychopy/iohub/server.py +2 -2
- psychopy/iohub/start_iohub_process.py +3 -0
- psychopy/iohub/util/__init__.py +62 -70
- psychopy/layout.py +5 -5
- psychopy/logging.py +8 -1
- psychopy/microphone.py +10 -37
- psychopy/platform_specific/__init__.py +0 -2
- psychopy/platform_specific/darwin.py +1 -3
- psychopy/platform_specific/linux.py +31 -33
- psychopy/platform_specific/win32.py +38 -13
- psychopy/plugins/__init__.py +148 -116
- psychopy/plugins/util.py +39 -0
- psychopy/preferences/Darwin.spec +4 -2
- psychopy/preferences/FreeBSD.spec +4 -2
- psychopy/preferences/Linux.spec +4 -2
- psychopy/preferences/Windows.spec +4 -2
- psychopy/preferences/baseNoArch.spec +4 -2
- psychopy/preferences/preferences.py +47 -24
- psychopy/projects/pavlovia.py +47 -4
- psychopy/scripts/psyexpCompile.py +0 -4
- psychopy/session.py +153 -21
- psychopy/sound/__init__.py +31 -21
- psychopy/sound/_base.py +20 -3
- psychopy/sound/audioclip.py +320 -33
- psychopy/sound/backend_ptb.py +47 -58
- psychopy/sound/backend_pygame.py +1 -1
- psychopy/sound/backend_pysound.py +6 -15
- psychopy/sound/transcribe.py +53 -0
- psychopy/tests/.DS_Store +0 -0
- psychopy/tests/data/.DS_Store +0 -0
- psychopy/tests/data/TestUnknownPluginComponent_load_resave.psyexp +135 -0
- psychopy/tests/data/Test_textbox/test_ori_0_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_0_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_0_top left.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_120_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_120_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_120_top left.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_180_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_180_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_180_top left.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_240_bottom right.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_240_center.png +0 -0
- psychopy/tests/data/Test_textbox/test_ori_240_top left.png +0 -0
- psychopy/tests/data/correctScript/.DS_Store +0 -0
- psychopy/tests/data/test_components/testClearKeyboard/testClearKeyboard.psyexp +200 -0
- psychopy/tests/data/test_session/.DS_Store +0 -0
- psychopy/tests/data/test_session/root/testFutureTrials/testFutureTrials.psyexp +155 -0
- psychopy/tests/data/test_session/root/testTrialNav/trialNav.psyexp +158 -0
- psychopy/tests/test_app/.DS_Store +0 -0
- psychopy/tests/test_app/conftest.py +2 -2
- psychopy/tests/test_app/test_speed.py +4 -1
- psychopy/tests/test_data/test_TrialHandler2.py +146 -1
- psychopy/tests/test_experiment/.DS_Store +0 -0
- psychopy/tests/test_experiment/needs_wx/genComponsTemplate.py +3 -3
- psychopy/tests/test_experiment/needs_wx/test_components.py +2 -2
- psychopy/tests/test_experiment/test_components/test_KeyboardComponent.py +28 -0
- psychopy/tests/test_experiment/test_components/test_UnknownPluginComponent.py +27 -0
- psychopy/tests/test_experiment/test_components/test_base_components.py +58 -0
- psychopy/tests/test_experiment/test_py2js.py +1 -1
- psychopy/tests/test_hardware/test_keyboard.py +31 -0
- psychopy/tests/test_hardware/test_ports.py +1 -11
- psychopy/tests/test_liaison/test_Liaison.py +47 -0
- psychopy/tests/test_misc/test_core.py +5 -0
- psychopy/tests/test_session/test_Session.py +5 -1
- psychopy/tests/test_tools/test_versionchooser.py +39 -8
- psychopy/tests/test_visual/test_all_stimuli.py +0 -97
- psychopy/tests/test_visual/test_image.py +6 -5
- psychopy/tests/test_visual/test_textbox.py +36 -0
- psychopy/tests/utils.py +4 -0
- psychopy/tools/filetools.py +1 -1
- psychopy/tools/pkgtools.py +160 -137
- psychopy/tools/versionchooser.py +10 -10
- psychopy/tools/wizard.py +3 -3
- psychopy/visual/.DS_Store +0 -0
- psychopy/visual/backends/pygletbackend.py +24 -13
- psychopy/visual/basevisual.py +5 -11
- psychopy/visual/button.py +2 -14
- psychopy/visual/helpers.py +5 -5
- psychopy/visual/line.py +1 -2
- psychopy/visual/movie2.py +7 -816
- psychopy/visual/movie3.py +7 -589
- psychopy/visual/movies/__init__.py +8 -11
- psychopy/visual/movies/frame.py +5 -2
- psychopy/visual/movies/players/ffpyplayer_player.py +5 -2
- psychopy/visual/noise.py +8 -7
- psychopy/visual/patch.py +7 -16
- psychopy/visual/radial.py +9 -7
- psychopy/visual/ratingscale.py +8 -1415
- psychopy/visual/secondorder.py +10 -9
- psychopy/visual/shape.py +7 -2
- psychopy/visual/text.py +1 -1
- psychopy/visual/textbox2/textbox2.py +28 -5
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/METADATA +8 -13
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/RECORD +307 -213
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/WHEEL +1 -1
- psychopy/app/Resources/click.png +0 -0
- psychopy/app/Resources/next.png +0 -0
- psychopy/experiment/components/patch/__init__.py +0 -121
- psychopy/experiment/components/patch/classic/patch.png +0 -0
- psychopy/experiment/components/patch/dark/patch.png +0 -0
- psychopy/experiment/components/patch/dark/patch@2x.png +0 -0
- psychopy/experiment/components/patch/light/patch.png +0 -0
- psychopy/experiment/components/patch/light/patch@2x.png +0 -0
- psychopy/experiment/components/ratingScale/__init__.py +0 -337
- psychopy/experiment/components/ratingScale/classic/ratingscale.png +0 -0
- psychopy/experiment/components/ratingScale/classic/ratingscale@2x.png +0 -0
- psychopy/experiment/components/ratingScale/dark/ratingScale@2x.png +0 -0
- psychopy/experiment/components/ratingScale/dark/ratingscale.png +0 -0
- psychopy/experiment/components/ratingScale/light/ratingScale@2x.png +0 -0
- psychopy/experiment/components/ratingScale/light/ratingscale.png +0 -0
- psychopy/platform_specific/posix.py +0 -16
- psychopy/tests/test_sound/test_microphone.py +0 -217
- psychopy/tests/test_visual/test_ratingScale.py +0 -299
- /psychopy/{app/Resources → assets}/Psychopy Window Favicon@16w.png +0 -0
- /psychopy/{app/Resources → assets}/Psychopy Window Favicon@32w.png +0 -0
- /psychopy/{app/Resources → assets}/USB-C.png +0 -0
- /psychopy/{app/Resources → assets}/USB.png +0 -0
- /psychopy/{app/Resources → assets}/creditCard.png +0 -0
- /psychopy/{app/Resources → assets}/default.mp3 +0 -0
- /psychopy/{app/Resources → assets}/default.mp4 +0 -0
- /psychopy/{app/Resources → assets}/default.png +0 -0
- /psychopy/{app/Resources → assets/templates}/instruct1.png +0 -0
- /psychopy/{app/Resources → assets/templates}/instruct2.png +0 -0
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/entry_points.txt +0 -0
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/licenses/AUTHORS.md +0 -0
- {psychopy-2024.1.4.dist-info → psychopy-2024.2.0.dist-info}/licenses/LICENSE +0 -0
psychopy/.DS_Store
ADDED
|
Binary file
|
psychopy/CHANGELOG.txt
CHANGED
|
@@ -15,6 +15,212 @@ to run on the same PsychoPy version even where a different version is installed
|
|
|
15
15
|
That setting often even allows PsychoPy to run experiments from versions that have not yet
|
|
16
16
|
been installed! If the dependencies haven't changed it will run.
|
|
17
17
|
|
|
18
|
+
PsychoPy 2024.1
|
|
19
|
+
-----------------
|
|
20
|
+
|
|
21
|
+
**Highlights:**
|
|
22
|
+
|
|
23
|
+
* **Counterbalance Routine**: Standalone Routine to handle counterbalancing *between participants*, using the "shelf" to maintain records inbetween
|
|
24
|
+
* **Piloting Mode**: Run experiments in "piloting" mode - adjusts settings to avoid common pitfalls while you're building (e.g. getting stuck in a full screen experiment), then switch to "running" when you're ready to start gathering data
|
|
25
|
+
* **Improved UI**: Toolbars across the app have a clearer layout for buttons and a more intuitive interface for Pavlovia. Runner especially has had a visual overhaul, with a lot more space for reading stdout/alerts and a new output specifically for Pavlovia sync messages.
|
|
26
|
+
* **Fixes to Eye tracker plugins**: Several eye trackers had not been working since being moved out to plugins and these should all now be back in operation
|
|
27
|
+
|
|
28
|
+
PsychoPy 2024.1.0
|
|
29
|
+
~~~~~~~~~~~~~~~~~
|
|
30
|
+
|
|
31
|
+
**New features and enhancements:**
|
|
32
|
+
|
|
33
|
+
* Added plugin support for standalone plugins by @mdcutone in #5866
|
|
34
|
+
* **Button Box Component**: Component for using button boxes, which will always have the same methods and properties but by installing plugins you can add functionality for different devices
|
|
35
|
+
* Allow speech-to-text engine configuration from Builder by @mdcutone in #5905
|
|
36
|
+
* Replace toolbars with a "Ribbon" by @TEParsons in #5920
|
|
37
|
+
* Method for processing device info on Windows by @TEParsons in #5940
|
|
38
|
+
* Added tools for creating and managing hardware interfaces by @mdcutone in #5950
|
|
39
|
+
* Allow expInfo fields to be ordered, required, hidden and deprioritised using a new name syntax by @TEParsons in #5949
|
|
40
|
+
* Added Counterbalance Routine (and Python implementation of Shelf) by @TEParsons in #5967
|
|
41
|
+
* Add component for Button Box, with plugin-able backends by @TEParsons in #6006
|
|
42
|
+
* Option in Builder to skip/customise frame rate check by @TEParsons in #6049
|
|
43
|
+
* Option in Builder to specify globalClock format by @TEParsons in #6048
|
|
44
|
+
* Added method to Window to get value of specific pixels by @mdcutone in #6054
|
|
45
|
+
* Added piloting mode by @TEParsons in #6066
|
|
46
|
+
* Add param to enable "rush" mode by @TEParsons in #6279
|
|
47
|
+
* Speed up plugin dialog by @mdcutone in #5796
|
|
48
|
+
* Better handling when opening e.g. png files in Coder by @TEParsons in #5788
|
|
49
|
+
* Speed up app by using faster string tools for labels and methods by @TEParsons in #5826
|
|
50
|
+
* Improved plugin installation method by @mdcutone in #5872
|
|
51
|
+
* Allow prefs dialog menu to be resized by @TEParsons in #5869
|
|
52
|
+
* Add method to manually create a keypress, photodiode response, etc. by @TEParsons in #6022
|
|
53
|
+
* Add option to ignore keypresses outside of PsychoPy window by @TEParsons in #6039
|
|
54
|
+
* Allow Sound to specify a Speaker rather than using general system audio by @TEParsons in #6079
|
|
55
|
+
* Add method to wait for responses to SerialDevice by @TEParsons in #6092
|
|
56
|
+
* Include link to project in "Successful sync" message by @TEParsons in #6171
|
|
57
|
+
* Silence "Unrecognised Parameter" warnings if params came from a plugin by @TEParsons in #6179
|
|
58
|
+
* Speed up experiment loading by @TEParsons in #6180
|
|
59
|
+
* Catch fails in Packages dialog by @TEParsons in #6193
|
|
60
|
+
* Hide components/routines from future versions by @TEParsons in #6200
|
|
61
|
+
* More intuitive label on Pavlovia project info update button by @TEParsons in #6217
|
|
62
|
+
* Added menu item in Builder to reveal current folder by @TEParsons in #6218
|
|
63
|
+
* Install packages in editable mode via a pyproject.toml file by @TEParsons in #6228
|
|
64
|
+
* Improvements to Code component UI behaviour by @TEParsons in #6265
|
|
65
|
+
* Open news from menu by @peircej in #6205
|
|
66
|
+
* Make expInfo dialog always on top by @TEParsons in #6301
|
|
67
|
+
|
|
68
|
+
**Bug fixes:**
|
|
69
|
+
|
|
70
|
+
* Fix matrix questions Survey Routine by @TEParsons in #5797
|
|
71
|
+
* Fix crash which happened if wx wasn't installed by @peircej in #5832
|
|
72
|
+
* Make sure icons & labels in preferences dialog are always visible by @TEParsons in #5868
|
|
73
|
+
* Handle when Component has no start time in JS by @TEParsons in #5864
|
|
74
|
+
* Static component was preventing Movie from starting by @TEParsons in #5928
|
|
75
|
+
* Change default logging level to warning by @suelynnmah in #5941
|
|
76
|
+
* Let experiments run without git installed by @TEParsons in #5939
|
|
77
|
+
* Fix bug whereby Brush wouldn't pick up on mouse clicks by @TEParsons in #6056
|
|
78
|
+
* Fix inconsistent data outside trial loop by @monique2208 in #6004
|
|
79
|
+
* Fix shape setting on Polygon-derived components (e.g. ROI) by @TEParsons in #5971
|
|
80
|
+
* Remove darc toolbox demos (maintainer no longer supporting package) by @RebeccaHirst in #6094
|
|
81
|
+
* Fixed error when `audioLib` is `None` by @mdcutone in #6103
|
|
82
|
+
* Handle unconventional launch methods (e.g. launching from command line with unrecognised args) by @peircej in #6118
|
|
83
|
+
* Fixed error with resizing "sash" in Preferences dialogby @mdcutone in #6146
|
|
84
|
+
* If psychtoolbox can't detect devices, log warning rather than crashing by @TEParsons in #6150
|
|
85
|
+
* Fixed error when using Save in Coder when there is no file open by @nvanhaute in #6158
|
|
86
|
+
* Fixed "missing reference" error with setting Sound device by @mdcutone in #6122
|
|
87
|
+
* Fix _set function for NoiseStim to handle input length by @simonfei123 in #6136
|
|
88
|
+
* Draw expected duration from Routine Settings in Builder by @TEParsons in #6190
|
|
89
|
+
* Fix error when loading window whose size is negative by @mdcutone in #6192
|
|
90
|
+
* Stop Builder from assuming the current folder is .../psychopy/app whenever filename is "untitled.psyexp" by @TEParsons in #6198
|
|
91
|
+
* Catch error when package info is missing by @mdcutone in #6202
|
|
92
|
+
* Experiments weren't working online if experiment name differed from filename by @TEParsons in #6221
|
|
93
|
+
* Fixed iohub eyetracker calibration (keyboard was losing input) by @mdcutone in #6226
|
|
94
|
+
* Handle when Static component has no start time by @TEParsons in #6248
|
|
95
|
+
* Don't scroll to top after opening a Builder component category by @TEParsons in #6251
|
|
96
|
+
* Fixed Mouse.visible attribute not applying requested state by @mdcutone in #6254
|
|
97
|
+
* Fixed freeze when running eyetracker validation by @mdcutone in #6264
|
|
98
|
+
* Fix error when cancelling a commit by @TEParsons in #6271
|
|
99
|
+
* Special code for when Slider is "radio" was missed in JS code by @TEParsons in #6272
|
|
100
|
+
* Fix "iCCP profiles" error with classic icons by @TEParsons in #6276
|
|
101
|
+
* Fix wrong setter name in Textbox/TextStim JS code by @TEParsons in #6277
|
|
102
|
+
* New Pavlovia projects were being created empty until first commit by @TEParsons in #6273
|
|
103
|
+
* Fix UI inconsistencies on Ubuntu by @TEParsons in #6242
|
|
104
|
+
* Fix code for sound component stop values by @zuazo in #6300
|
|
105
|
+
* Fixed selecting audio device in builder and coder by @zuazo in #6299
|
|
106
|
+
* Fix bug where local PsychoJS server kept running after quitting by @TEParsons in #6323
|
|
107
|
+
|
|
108
|
+
**Documentation and testing improvements** by @alexander-pastukhov @peircej @suelynnmah @patrickabolger @richardnaar @JensBoelte
|
|
109
|
+
@d-scanzi @psych575 @shun2wang @Solveig-Castelli @carosamu @Ahmad-Abudoush @RebeccaHirst @ice-yu @domstoppable @kimDundas
|
|
110
|
+
@afuetterer @TEParsons
|
|
111
|
+
|
|
112
|
+
**Translation works:**
|
|
113
|
+
|
|
114
|
+
* Continued translation into Simplified Chinese (and now Traditional Chinese) and beginnings of translations into Spanish, Hebrew: #5891 #5892 #5893 #5894 #5895 #5897 #5904 #5912 #5915 #5917 #5923 #5903 #5932 #5925
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### New contributors
|
|
118
|
+
|
|
119
|
+
* @mscheltienne made their first contribution in #5889
|
|
120
|
+
* @JensBoelte made their first contribution in #5956
|
|
121
|
+
* @d-scanzi made their first contribution in #5952
|
|
122
|
+
* @kshtjkumar made their first contribution in #5955
|
|
123
|
+
* @Solveig-Castelli made their first contribution in #5961
|
|
124
|
+
* @carosamu made their first contribution in #5972
|
|
125
|
+
* @monique2208 made their first contribution in #6004
|
|
126
|
+
* @afuetterer made their first contribution in #6110
|
|
127
|
+
* @bartuatabek made their first contribution in #5942
|
|
128
|
+
* @FS94 made their first contribution in #6121
|
|
129
|
+
* @simonfei123 made their first contribution in #6136
|
|
130
|
+
* @tomdstone made their first contribution in #6261
|
|
131
|
+
* @zuazo made their first contribution in #6299
|
|
132
|
+
|
|
133
|
+
**Full Changelog**: https://github.com/psychopy/psychopy/compare/2023.2.3...2024.1.0
|
|
134
|
+
|
|
135
|
+
PsychoPy 2024.1.1
|
|
136
|
+
~~~~~~~~~~~~~~~~~
|
|
137
|
+
|
|
138
|
+
**Bug fixes**
|
|
139
|
+
|
|
140
|
+
* Handle errors when loading list of plugins by @TEParsons in #6334
|
|
141
|
+
* Counterbalance in online studies was still trying to confirm entries after finishing by @TEParsons in #6345
|
|
142
|
+
* Make sure the drawn max time in Builder is never None by @TEParsons in #6347
|
|
143
|
+
* Fixed translation issues by @hsogo in #6348
|
|
144
|
+
* Fixed inability to load plugins list from local with non-utf-8 default encoding by @peircej in #6349
|
|
145
|
+
|
|
146
|
+
**Full Changelog**: https://github.com/psychopy/psychopy/compare/2024.1.0...2024.1.1
|
|
147
|
+
|
|
148
|
+
PsychoPy 2024.1.2
|
|
149
|
+
~~~~~~~~~~~~~~~~~
|
|
150
|
+
|
|
151
|
+
**Enhancements**
|
|
152
|
+
* Default TextStim font set to Arial (TextBox default was already Arial) by @wakecarter in #6378
|
|
153
|
+
|
|
154
|
+
**Bug fixes**
|
|
155
|
+
|
|
156
|
+
* Keyboard clock wasn't being reset properly, so `.rt` values were from exp start by @TEParsons in #6360
|
|
157
|
+
* Safer (and faster) behaviour when copying a param, avoids "infinite recursion" (app hangs) by @TEParsons in #6362
|
|
158
|
+
* Make line spacing specific to just one TextBox2 object by @Catherine9811 in #6356
|
|
159
|
+
* Fixes to the Gazepoint eyetracker plugin by @mdcutone in #6365
|
|
160
|
+
* Fixed error when camera tries to close when it's already closed by @mdcutone in #6364
|
|
161
|
+
* Fixed editable TextBox2 cursor location with line breaks by @Catherine9811 in #6358
|
|
162
|
+
* Remove "constant" updates option from SoundComponent (as it wasn't used) by @TEParsons in #6351
|
|
163
|
+
* Python 3.8 was falsely marked as incompatible with 2024.1.x onwards in "use version" interface by @TEParsons in #6366
|
|
164
|
+
* Form Component wasn't finding the correct table template by @TEParsons in #6381
|
|
165
|
+
* Remove blank rows from form template by @wakecarter in #6382
|
|
166
|
+
* Error saving icons from plugin details by @TEParsons in #6368
|
|
167
|
+
* Transparent colours online by @wakecarter in #6386
|
|
168
|
+
* Button numclicks defined by timesOn.length by @wakecarter in #6385
|
|
169
|
+
|
|
170
|
+
**Documentation and testing improvements** by... @peircej @TEParsons @kimDundas @suelynnmah
|
|
171
|
+
|
|
172
|
+
**New contributors: **
|
|
173
|
+
|
|
174
|
+
* @Catherine9811 made their first contribution in #6356
|
|
175
|
+
|
|
176
|
+
**Full Changelog**: https://github.com/psychopy/psychopy/compare/2024.1.1...2024.1.2
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
PsychoPy 2024.1.3
|
|
180
|
+
~~~~~~~~~~~~~~~~~
|
|
181
|
+
|
|
182
|
+
**Bug fixes**
|
|
183
|
+
|
|
184
|
+
* Telling Mouse Component to check new clicks without clickable stim raised syntax error by @TEParsons in #6398
|
|
185
|
+
* Keyboard responses in ioHub weren't using relative time by @TEParsons in #6407
|
|
186
|
+
|
|
187
|
+
PsychoPy 2024.1.4
|
|
188
|
+
~~~~~~~~~~~~~~~~~
|
|
189
|
+
|
|
190
|
+
**Bug fixes**
|
|
191
|
+
|
|
192
|
+
* ioHub keyboard was registering key releases before presses, so duration was always None. We now have a test in place that confirms keyboard RT timing using hardware which will be used on each new release going forwards. By @TEParsons in #6416
|
|
193
|
+
* Fixed some translation issues by @hsogo in #6409
|
|
194
|
+
* Fixed JSON encoding error when opening plugin dialog by @mdcutone in #6411
|
|
195
|
+
|
|
196
|
+
**Documentation updates**
|
|
197
|
+
|
|
198
|
+
* updated screenshots by @charlottej3673 in #6392
|
|
199
|
+
|
|
200
|
+
PsychoPy 2024.1.5
|
|
201
|
+
~~~~~~~~~~~~~~~~~
|
|
202
|
+
|
|
203
|
+
* Failing to find Eyetracker Components (Eyelink by @KirstenWilliams in #6406 and Gazepoint by @mdcutone in #6424 )
|
|
204
|
+
* Installed plugins were not being found on Linux/MacOS by @mdcutone in #6441
|
|
205
|
+
* Faster MovieStim rendering (don't call `play()` when already playing) by @aforren1 in #6448
|
|
206
|
+
* Fixed eyetracker calibration target units (height -> pix) by @peircej in #6451
|
|
207
|
+
* KeyboardComponent allowed keys from spreadsheet caused namespace errors by @TEParsons in #6458
|
|
208
|
+
* hide that visible mouse, please by @mh105 in #6465
|
|
209
|
+
* Fix an issue with etRecord component for Stop Only (not stopping the eytracker) by @mh105 in #6463
|
|
210
|
+
* Only change Mouse visibility if explicitly asked to by @TEParsons in #6467
|
|
211
|
+
* Fix "Stop only" issue regardless of Component order by @TEParsons in #6468
|
|
212
|
+
* Clear keys to initialize keyboard when starting a routine by @mh105 in #6471
|
|
213
|
+
* Allow getKeys() to return the same key pressed multiple times by @mh105 in #6479
|
|
214
|
+
|
|
215
|
+
## Documentation fixes and updates
|
|
216
|
+
|
|
217
|
+
* by @suelynnmah in #6341 #6426 #6427
|
|
218
|
+
* by @KirstenWilliams in #6480 #6481 #6487 #6498 #6506
|
|
219
|
+
* by @RebeccaHirst in #6504 #6505
|
|
220
|
+
* Arabic app translations by @Ahmad-Abudoush in #6476
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
**Full Changelog**: https://github.com/psychopy/psychopy/compare/2024.1.4...2024.1.5
|
|
18
224
|
|
|
19
225
|
PsychoPy 2023.2
|
|
20
226
|
---------------
|
psychopy/GIT_SHA
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
21e8c98452ff86f45dcc22206bef29647fe6a0da
|
psychopy/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2024.2.0
|
psychopy/__init__.py
CHANGED
|
@@ -5,21 +5,22 @@
|
|
|
5
5
|
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2024 Open Science Tools Ltd.
|
|
6
6
|
# Distributed under the terms of the GNU General Public License (GPL).
|
|
7
7
|
|
|
8
|
-
# --------------------------------------------------------------------------
|
|
9
|
-
# This file is automatically generated during build (do not edit directly).
|
|
10
|
-
# --------------------------------------------------------------------------
|
|
11
|
-
|
|
12
8
|
import os
|
|
13
9
|
import sys
|
|
10
|
+
import pathlib
|
|
11
|
+
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
def getVersion():
|
|
14
|
+
return (pathlib.Path(__file__).parent/"VERSION").read_text(encoding="utf-8").strip()
|
|
15
|
+
|
|
16
|
+
__version__ = getVersion()
|
|
17
|
+
__git_sha__ = (pathlib.Path(__file__).parent/"GIT_SHA").read_text(encoding="utf-8").strip()
|
|
16
18
|
__license__ = 'GPL v3'
|
|
17
19
|
__author__ = 'Open Science Tools Ltd'
|
|
18
20
|
__author_email__ = 'support@opensciencetools.org'
|
|
19
21
|
__maintainer_email__ = 'support@opensciencetools.org'
|
|
20
22
|
__url__ = 'https://www.psychopy.org/'
|
|
21
23
|
__download_url__ = 'https://github.com/psychopy/psychopy/releases/'
|
|
22
|
-
__git_sha__ = '8ccc6ec19'
|
|
23
24
|
__build_platform__ = 'n/a'
|
|
24
25
|
|
|
25
26
|
__all__ = ["gui", "misc", "visual", "core",
|
|
@@ -42,17 +43,78 @@ if __git_sha__ == 'n/a':
|
|
|
42
43
|
# update preferences and the user paths
|
|
43
44
|
if 'installing' not in locals():
|
|
44
45
|
from psychopy.preferences import prefs
|
|
46
|
+
import site
|
|
47
|
+
|
|
48
|
+
# Configure the environment to use our custom site-packages location for
|
|
49
|
+
# user-installed packages. In the future, this will be configured outside of
|
|
50
|
+
# the running environment, but for now, we need to do it here.
|
|
51
|
+
useDefaultSite = False
|
|
52
|
+
if 'PSYCHOPYNOPACKAGES' in os.environ:
|
|
53
|
+
# Custom environment variable for people using PsychoPy as a library,
|
|
54
|
+
# who don't want to use the custom site-packages location. If set to 1,
|
|
55
|
+
# this will disable the custom site-packages location. Packages will be
|
|
56
|
+
# installed in the default, system dependent user's site-packages
|
|
57
|
+
# location.
|
|
58
|
+
useDefaultSite = os.environ['PSYCHOPYNOPACKAGES'] == '1'
|
|
59
|
+
|
|
60
|
+
# configure environment for custom site-packages location
|
|
61
|
+
if not useDefaultSite:
|
|
62
|
+
env = os.environ.copy()
|
|
63
|
+
if 'PYTHONPATH' in env: # append entries to existing PYTHONPATH
|
|
64
|
+
_userSitePackages = str(prefs.paths['userPackages'])
|
|
65
|
+
if _userSitePackages not in env['PYTHONPATH']:
|
|
66
|
+
env['PYTHONPATH'] = os.pathsep.join([
|
|
67
|
+
env['PYTHONPATH'], _userSitePackages])
|
|
68
|
+
_userPackages = str(prefs.paths['packages'])
|
|
69
|
+
if _userPackages not in env['PYTHONPATH']:
|
|
70
|
+
env['PYTHONPATH'] = os.pathsep.join([
|
|
71
|
+
env['PYTHONPATH'], _userPackages])
|
|
72
|
+
else:
|
|
73
|
+
env['PYTHONPATH'] = os.pathsep.join([
|
|
74
|
+
str(prefs.paths['userPackages']),
|
|
75
|
+
str(prefs.paths['packages'])])
|
|
76
|
+
|
|
77
|
+
# set user site packages
|
|
78
|
+
env['PYTHONUSERBASE'] = prefs.paths['packages']
|
|
79
|
+
|
|
80
|
+
# update environment, pass this to sub-processes (e.g. pip)
|
|
81
|
+
os.environ.update(env)
|
|
82
|
+
|
|
83
|
+
# make sure site knows about our custom user site-packages
|
|
84
|
+
site.USER_SITE = prefs.paths['userPackages']
|
|
85
|
+
site.ENABLE_USER_SITE = True
|
|
86
|
+
# site.main()
|
|
87
|
+
|
|
88
|
+
# add paths from main plugins/packages (installed by plugins manager)
|
|
89
|
+
site.addsitedir(prefs.paths['userPackages']) # user site-packages
|
|
90
|
+
site.addsitedir(prefs.paths['userInclude']) # user include
|
|
91
|
+
site.addsitedir(prefs.paths['packages']) # base package dir
|
|
92
|
+
|
|
93
|
+
_envPath = os.environ.get('PATH', None)
|
|
94
|
+
if _envPath is not None:
|
|
95
|
+
# add user include path to system PATH (for C extensions)
|
|
96
|
+
if str(prefs.paths['userInclude']) not in _envPath:
|
|
97
|
+
os.environ['PATH'] = os.pathsep.join([
|
|
98
|
+
os.environ['PATH'], str(prefs.paths['userInclude'])])
|
|
99
|
+
# add scripts path for user packages to system PATH
|
|
100
|
+
if str(prefs.paths['userScripts']) not in _envPath:
|
|
101
|
+
os.environ['PATH'] = os.pathsep.join([
|
|
102
|
+
os.environ['PATH'], str(prefs.paths['userScripts'])])
|
|
103
|
+
|
|
104
|
+
if sys.platform == 'darwin' and sys._framework:
|
|
105
|
+
# add scripts path for user packages to system PATH
|
|
106
|
+
fwBinPath = os.path.join(sys.prefix, 'bin')
|
|
107
|
+
if fwBinPath not in os.environ['PATH']:
|
|
108
|
+
os.environ['PATH'] = os.pathsep.join([
|
|
109
|
+
fwBinPath, os.environ['PATH']])
|
|
110
|
+
|
|
111
|
+
# add paths from general preferences
|
|
45
112
|
for _pathName in prefs.general['paths']:
|
|
46
113
|
sys.path.append(_pathName)
|
|
47
114
|
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if _userPackagePath.is_dir():
|
|
52
|
-
sys.path.append(str(_userPackagePath)) # user site-packages
|
|
53
|
-
sys.path.append(str(_userScripts)) # user scripts
|
|
54
|
-
|
|
55
|
-
# add paths from individual plugins/packages (installed by plugins manager)
|
|
115
|
+
# Add paths from individual plugins/packages (installed by plugins manager),
|
|
116
|
+
# this is to support legacy plugins that don't use the customized user
|
|
117
|
+
# site-packages location. This will be removed in the future.
|
|
56
118
|
import pathlib as _pathlib
|
|
57
119
|
for _pathName in _pathlib.Path(prefs.paths['packages']).glob("*"):
|
|
58
120
|
if _pathName.is_dir():
|
|
@@ -60,6 +122,7 @@ if 'installing' not in locals():
|
|
|
60
122
|
|
|
61
123
|
from psychopy.tools.versionchooser import useVersion, ensureMinimal
|
|
62
124
|
|
|
125
|
+
|
|
63
126
|
if sys.version_info.major < 3:
|
|
64
127
|
raise ImportError("psychopy does not support Python2 installations. "
|
|
65
128
|
"The last version to support Python2.7 was PsychoPy "
|
|
@@ -71,4 +134,3 @@ try:
|
|
|
71
134
|
import readline
|
|
72
135
|
except ImportError:
|
|
73
136
|
pass # all that will happen is the stderr/stdout might get redirected
|
|
74
|
-
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
psychopy/app/__init__.py
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
__all__ = [
|
|
12
12
|
'startApp',
|
|
13
13
|
'quitApp',
|
|
14
|
+
'restartApp',
|
|
15
|
+
'setRestartRequired',
|
|
16
|
+
'isRestartRequired',
|
|
14
17
|
'getAppInstance',
|
|
15
18
|
'getAppFrame',
|
|
16
19
|
'isAppStarted']
|
|
@@ -24,8 +27,13 @@ from .frametracker import openFrames
|
|
|
24
27
|
# to allow the plugin system to access GUI to allow for changes after startup.
|
|
25
28
|
_psychopyAppInstance = None
|
|
26
29
|
|
|
30
|
+
# Flag to indicate if the app requires a restart. This is set by the app when
|
|
31
|
+
# it needs to restart after an update or plugin installation. We can check this
|
|
32
|
+
# flag to determine if the app is in a state that it is recommended to restart.
|
|
33
|
+
REQUIRES_RESTART = False
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
|
|
36
|
+
def startApp(showSplash=True, testMode=False, safeMode=False, startView=None):
|
|
29
37
|
"""Start the PsychoPy GUI.
|
|
30
38
|
|
|
31
39
|
This function is idempotent, where additional calls after the app starts
|
|
@@ -52,6 +60,11 @@ def startApp(showSplash=True, testMode=False, safeMode=False):
|
|
|
52
60
|
safeMode : bool
|
|
53
61
|
Start PsychoPy in safe-mode. If `True`, the GUI application will launch
|
|
54
62
|
with without loading plugins.
|
|
63
|
+
startView : str, None
|
|
64
|
+
Name of the view to start the app with. Valid values are 'coder',
|
|
65
|
+
'builder' or 'runner'. If `None`, the app will start with the default
|
|
66
|
+
view or the view specifed with the `PSYCHOPYSTARTVIEW` environment
|
|
67
|
+
variable.
|
|
55
68
|
|
|
56
69
|
"""
|
|
57
70
|
global _psychopyAppInstance
|
|
@@ -82,7 +95,7 @@ def startApp(showSplash=True, testMode=False, safeMode=False):
|
|
|
82
95
|
# console.
|
|
83
96
|
from psychopy.app._psychopyApp import PsychoPyApp
|
|
84
97
|
_psychopyAppInstance = PsychoPyApp(
|
|
85
|
-
0, testMode=testMode, showSplash=showSplash, safeMode=safeMode)
|
|
98
|
+
0, testMode=testMode, showSplash=showSplash, safeMode=safeMode, startView=startView)
|
|
86
99
|
|
|
87
100
|
# After the app is loaded, we hand off logging to the stream dispatcher
|
|
88
101
|
# using the provided log file path. The dispatcher will write out any log
|
|
@@ -131,6 +144,65 @@ def quitApp():
|
|
|
131
144
|
raise AttributeError('Object `_psychopyApp` has no attribute `quit`.')
|
|
132
145
|
|
|
133
146
|
|
|
147
|
+
def restartApp():
|
|
148
|
+
"""Restart the PsychoPy application instance.
|
|
149
|
+
|
|
150
|
+
This will write a file named '.restart' to the user preferences directory
|
|
151
|
+
and quit the application. The presence of this file will indicate to the
|
|
152
|
+
launcher parent process that the app should restart.
|
|
153
|
+
|
|
154
|
+
The app restarts with the same arguments as the original launch. This is
|
|
155
|
+
useful for updating the application or plugins without requiring the user
|
|
156
|
+
to manually restart the app.
|
|
157
|
+
|
|
158
|
+
The user will be prompted to save any unsaved work before the app restarts.
|
|
159
|
+
|
|
160
|
+
"""
|
|
161
|
+
if not isAppStarted():
|
|
162
|
+
return
|
|
163
|
+
|
|
164
|
+
# write a restart file to the user preferences directory
|
|
165
|
+
from psychopy.preferences import prefs
|
|
166
|
+
restartFilePath = os.path.join(prefs.paths['userPrefsDir'], '.restart')
|
|
167
|
+
|
|
168
|
+
with open(restartFilePath, 'w') as restartFile:
|
|
169
|
+
restartFile.write('') # empty file
|
|
170
|
+
|
|
171
|
+
quitApp()
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def setRestartRequired(state=True):
|
|
175
|
+
"""Set the flag to indicate that the app requires a restart.
|
|
176
|
+
|
|
177
|
+
This function is used by the app to indicate that a restart is required
|
|
178
|
+
after an update or plugin installation. The flag is checked by the launcher
|
|
179
|
+
parent process to determine if the app should restart.
|
|
180
|
+
|
|
181
|
+
Parameters
|
|
182
|
+
----------
|
|
183
|
+
state : bool
|
|
184
|
+
Set the restart flag. If `True`, the app will restart after quitting.
|
|
185
|
+
|
|
186
|
+
"""
|
|
187
|
+
global REQUIRES_RESTART
|
|
188
|
+
REQUIRES_RESTART = bool(state)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def isRestartRequired():
|
|
192
|
+
"""Check if the app requires a restart.
|
|
193
|
+
|
|
194
|
+
Parts of the application may set this flag to indicate that a restart is
|
|
195
|
+
required after an update or plugin installation.
|
|
196
|
+
|
|
197
|
+
Returns
|
|
198
|
+
-------
|
|
199
|
+
bool
|
|
200
|
+
`True` if the app requires a restart else `False`.
|
|
201
|
+
|
|
202
|
+
"""
|
|
203
|
+
return REQUIRES_RESTART
|
|
204
|
+
|
|
205
|
+
|
|
134
206
|
def getAppInstance():
|
|
135
207
|
"""Get a reference to the `PsychoPyApp` object.
|
|
136
208
|
|
|
@@ -216,6 +288,8 @@ def getAppFrame(frameName):
|
|
|
216
288
|
_psychopyAppInstance.showRunner()
|
|
217
289
|
else:
|
|
218
290
|
raise AttributeError('Cannot load frame. Method not available.')
|
|
291
|
+
|
|
292
|
+
frameRef = getattr(_psychopyAppInstance, frameName, None)
|
|
219
293
|
|
|
220
294
|
return frameRef
|
|
221
295
|
|