Skip to content

Commit 33a6aad

Browse files
committed
Fixed bug with global variables; fixing logging filenames; set initialize_delay of scripts to 0
1 parent f8229fe commit 33a6aad

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

fonts/FreeMono.ttf

-579 KB
Binary file not shown.

fonts/FreeSans.ttf

-1.49 MB
Binary file not shown.

main.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import sys
12
import os
23
import glob
34

5+
import pygame
46
import expyriment
57
import android
68

79

8-
android.init()
9-
android.map_key(android.KEYCODE_BACK, pygame.K_ESCAPE)
10-
1110
def main():
11+
android.init()
12+
1213
projects = {}
1314
for folder in glob.glob("/mnt/*"):
1415
if os.path.isdir(folder):
@@ -44,9 +45,9 @@ def main():
4445
aliases = (
4546
('monospace', 'misc-fixed', 'courier', 'couriernew', 'console',
4647
'fixed', 'mono', 'freemono', 'bitstreamverasansmono',
47-
'verasansmono', 'monotype', 'lucidaconsole', 'droidsansmono),
48+
'verasansmono', 'monotype', 'lucidaconsole', 'droidsansmono'),
4849
('sans', 'arial', 'helvetica', 'swiss', 'freesans',
49-
'bitstreamverasans', 'verasans', 'verdana', 'tahoma', 'droidsans),
50+
'bitstreamverasans', 'verasans', 'verdana', 'tahoma', 'droidsans'),
5051
('serif', 'times', 'freeserif', 'bitstreamveraserif', 'roman',
5152
'timesroman', 'timesnewroman', 'dutch', 'veraserif',
5253
'georgia', 'droidserif'),
@@ -82,8 +83,10 @@ def main():
8283
scroll_menu=5, mouse=mouse)
8384
py_file = projects[menu.get()]
8485
expyriment.control.defaults.event_logging = 1
86+
expyriment.control.defaults.initialize_delay = 0
8587
os.chdir(os.path.split(py_file)[0])
86-
execfile("{0}".format(py_file))
88+
sys.argv[0] = py_file
89+
execfile("{0}".format(py_file), globals())
8790

8891

8992
if __name__ == "__main__":

0 commit comments

Comments
 (0)