/usr/share/pyshared/libqtopensesame/misc/includes.py is in opensesame 0.27.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | #-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenSesame is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSesame. If not, see <http://www.gnu.org/licenses/>.
***
This file includes all kinds of things so that py2exe incorporates
them into the distribution. This is necessary, because items are
loaded at runtime, and therefore escape the detection of py2exe.
"""
import sys
from libopensesame import debug
# Below is a quick hack to deal with pylinks quirky behavior.
# Pylink needs to be imported prior to pygame, otherwise it
# gives a DLL not found error. However, if we use a regular
# import statement, py2exe will include pylink with OpenSesame
# which is not allowed. This hack loads pylink if available,
# prior to pygame, without giving an error if pylink is not
# installed.
if "--pylink" in sys.argv:
try:
exec("import pylink") # This makes sure that py2exe doesn't try to include pylink
except Exception as e:
debug.msg( \
"failed to import pylink module. You will not be able to use eyelink connectivity")
# Explicitly importing these modules ensures that Py2exe will
# bundle them. This is therefore only required for Windows.
if "--preload" in sys.argv:
import warnings
debug.msg("preloading modules ...")
debug.msg("preloading 'legacy' back-end")
try:
import openexp,\
openexp._canvas.legacy,\
openexp._keyboard.legacy,\
openexp._mouse.legacy,\
openexp._sampler.legacy,\
openexp._synth.legacy
except Exception as e:
debug.msg("failed to import 'legacy' back-end. Error: %s" % e)
debug.msg("preloading 'opengl' back-end")
try:
import openexp,\
openexp._canvas.xpyriment,\
openexp._mouse.xpyriment
except Exception as e:
debug.msg("failed to import 'xpyriment' back-end. Error: %s" % e)
debug.msg("preloading 'opengl' back-end")
try:
import openexp,\
openexp._canvas.opengl
except Exception as e:
debug.msg("failed to import 'opengl' back-end. Error: %s" % e)
debug.msg("preloading 'psycho' back-end")
try:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import openexp,\
openexp._canvas.psycho,\
openexp._keyboard.psycho,\
openexp._mouse.psycho
except Exception as e:
debug.msg("failed to import 'psycho' back-end. Error: %s" % e)
debug.msg("preloading 'psychopy'")
try:
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from psychopy import core, visual, data, event, filters, gui, hardware, log, misc, monitors, sound, platform_specific # info, serial and parallel produce errors
except Exception as e:
debug.msg("failed to import 'psychopy' <http://www.psychopy.org/>. You will not be able to use PsychoPy or the psycho back-end. Error: %s" % e)
debug.msg("preloading 'pyffmpeg'")
try:
import pyffmpeg
import pyffmpeg_numpybindings
from audioqueue import AudioQueue, Queue_Empty, Queue_Full
except Exception as e:
debug.msg("failed to import 'pyffmpeg' <http://code.google.com/p/pyffmpeg/>. You will not be able to use the media_player plug-in. Error: %s" % e)
debug.msg("preloading 'PIL'")
try:
# The correct way to import PIL appears to depend on the version. So
# try both methods.
try:
import PIL
import PIL.Image
except:
import Image
except Exception as e:
debug.msg("failed to import 'PIL' <http://www.pythonware.com/products/pil/>. You will not be able the Python Imaging library. Error: %s" % e)
debug.msg("preloading 'pyaudio'")
try:
import pyaudio
except Exception as e:
debug.msg("failed to import 'pyaudio' <http://people.csail.mit.edu/hubert/pyaudio/>. You will not be able to use portaudio and the media_player plug-in. Error: %s" % e)
debug.msg("preloading 'wave'")
try:
import wave
except Exception as e:
debug.msg("failed to import 'wave'. Error: %s" % e)
# OpenGL requires hacks to work with Py2Exe. The approach here is based on
# information from <http://www.py2exe.org/index.cgi/PyOpenGL>
debug.msg("preloading 'OpenGL'")
try:
from OpenGL.GL import *
from OpenGL.platform import win32
except AttributeError:
pass
try:
from ctypes import util
import OpenGL
except Exception as e:
debug.msg("failed to import 'OpenGL' <http://pyopengl.sourceforge.net/>. You will not be able to use OpenGL. Error: %s" % e)
debug.msg("preloading 'cv'")
try:
import cv
except Exception as e:
debug.msg("failed to import 'cv' <http://opencv.willowgarage.com/wiki/>. You will not be able to use the Open Computer Vision libraries. Error: %s" % e)
debug.msg("preloading 'serial'")
try:
import serial
except Exception as e:
debug.msg("failed to import 'serial' module <http://pyserial.sourceforge.net/>. You will not be able to use serial port connectivity. Error: %s" % e)
debug.msg("preloading 'parallel'")
try:
import parallel
import parallel.parallelutil
except Exception as e:
debug.msg("failed to import 'parallel' module <http://pyserial.sourceforge.net/pyparallel.html>. You will not be able to use parallel port connectivity. Error: %s" % e)
debug.msg("preloading 'pyglet'")
try:
import pyglet
except Exception as e:
debug.msg("failed to import 'pyglet' module <http://www.pyglet.org/>. You will not be able to use PsychoPy. Error: %s" % e)
debug.msg("preloading modules required by questionnaire plug-ins")
try:
import htmllib
import htmlentitydefs
import HTMLParser
import sgmllib
import markupbase
except Exception as e:
debug.msg("failed to import modules required by questionnaire plug-ins")
debug.msg("preloading IPython")
try:
from IPython.frontend.qt.console.ipython_widget import IPythonWidget
from IPython.frontend.qt.kernelmanager import QtKernelManager
from IPython.utils.localinterfaces import LOCALHOST
except Exception as e:
debug.msg("failed to import IPython <http://www.ipython.org/>. You will not be able to use the IPython console. Error: %s" % e)
debug.msg("preloading OSX dependencies")
try:
from libqtopensesame.widgets import pool_widget, statusbar, tree_overview, toolbar_items, variable_inspector, good_looking_table
from libqtopensesame.items import exceptions, experiment, feedback, generic_response, inline_script, item, keyboard_response, logger, loop, misc, mouse_response, plugins, sampler, sequence, sketchpad, synth
except Exception as e:
debug.msg('Failed to load libqtopensesame.items modules')
try:
import pygame._view
except Exception as e:
debug.msg('Failed to load pygame._view')
|