Skip to content

Commit

Permalink
TEST: add order to list of Builder component properties to check wi…
Browse files Browse the repository at this point in the history
…th x.py

- update the profile
- several order == [] have now become ['name'], which is fine
  • Loading branch information
jeremygray committed Jul 19, 2014
1 parent de5cd78 commit dc5a108
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
37 changes: 19 additions & 18 deletions psychopy/tests/test_app/test_builder/x.out.master.de55d49
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ApertureComponent.order: ['name', 'size', 'pos']
ApertureComponent.name.default: aperture
ApertureComponent.name.staticUpdater: None
ApertureComponent.name.val: aperture
ApertureComponent.name.allowedTypes: []
ApertureComponent.name.allowedVals: []
ApertureComponent.name.allowedUpdates: None
ApertureComponent.name.updates: constant
ApertureComponent.name.valType: code
ApertureComponent.stopVal.default: 1.0
ApertureComponent.stopVal.staticUpdater: None
Expand Down Expand Up @@ -78,6 +78,7 @@ ApertureComponent.size.allowedVals: []
ApertureComponent.size.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
ApertureComponent.size.updates: constant
ApertureComponent.size.valType: code
CodeComponent.order: ['name', 'Begin Experiment', 'Begin Routine', 'Each Frame', 'End Routine', 'End Experiment']
CodeComponent.Begin Experiment.default:
CodeComponent.Begin Experiment.staticUpdater: None
CodeComponent.Begin Experiment.val:
Expand All @@ -92,7 +93,6 @@ CodeComponent.name.val: code
CodeComponent.name.allowedTypes: []
CodeComponent.name.allowedVals: []
CodeComponent.name.allowedUpdates: None
CodeComponent.name.updates: None
CodeComponent.name.valType: code
CodeComponent.Each Frame.default:
CodeComponent.Each Frame.staticUpdater: None
Expand Down Expand Up @@ -126,6 +126,7 @@ CodeComponent.End Experiment.allowedVals: []
CodeComponent.End Experiment.allowedUpdates: []
CodeComponent.End Experiment.updates: constant
CodeComponent.End Experiment.valType: extendedCode
DotsComponent.order: []
DotsComponent.color.default: [1.0,1.0,1.0]
DotsComponent.color.staticUpdater: None
DotsComponent.color.val: $[1.0,1.0,1.0]
Expand Down Expand Up @@ -284,7 +285,6 @@ DotsComponent.name.val: dots
DotsComponent.name.allowedTypes: []
DotsComponent.name.allowedVals: []
DotsComponent.name.allowedUpdates: None
DotsComponent.name.updates: None
DotsComponent.name.valType: code
DotsComponent.dotSize.default: 2
DotsComponent.dotSize.staticUpdater: None
Expand All @@ -302,6 +302,7 @@ DotsComponent.dir.allowedVals: []
DotsComponent.dir.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
DotsComponent.dir.updates: constant
DotsComponent.dir.valType: code
GratingComponent.order: ['tex', 'mask']
GratingComponent.opacity.default: 1
GratingComponent.opacity.staticUpdater: None
GratingComponent.opacity.val: 1
Expand Down Expand Up @@ -332,7 +333,6 @@ GratingComponent.name.val: grating
GratingComponent.name.allowedTypes: []
GratingComponent.name.allowedVals: []
GratingComponent.name.allowedUpdates: None
GratingComponent.name.updates: constant
GratingComponent.name.valType: code
GratingComponent.color.default: [1,1,1]
GratingComponent.color.staticUpdater: None
Expand Down Expand Up @@ -462,6 +462,7 @@ GratingComponent.size.allowedVals: []
GratingComponent.size.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
GratingComponent.size.updates: constant
GratingComponent.size.valType: code
ImageComponent.order: []
ImageComponent.opacity.default: 1
ImageComponent.opacity.staticUpdater: None
ImageComponent.opacity.val: 1
Expand Down Expand Up @@ -492,7 +493,6 @@ ImageComponent.name.val: image
ImageComponent.name.allowedTypes: []
ImageComponent.name.allowedVals: []
ImageComponent.name.allowedUpdates: None
ImageComponent.name.updates: constant
ImageComponent.name.valType: code
ImageComponent.color.default: [1,1,1]
ImageComponent.color.staticUpdater: None
Expand Down Expand Up @@ -622,6 +622,7 @@ ImageComponent.size.allowedVals: []
ImageComponent.size.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
ImageComponent.size.updates: constant
ImageComponent.size.valType: code
KeyboardComponent.order: ['forceEndRoutine', 'allowedKeys', 'store', 'storeCorrect', 'correctAns']
KeyboardComponent.correctAns.default: ''
KeyboardComponent.correctAns.staticUpdater: None
KeyboardComponent.correctAns.val:
Expand All @@ -644,7 +645,6 @@ KeyboardComponent.name.val: key_resp
KeyboardComponent.name.allowedTypes: []
KeyboardComponent.name.allowedVals: []
KeyboardComponent.name.allowedUpdates: None
KeyboardComponent.name.updates: None
KeyboardComponent.name.valType: code
KeyboardComponent.stopVal.default:
KeyboardComponent.stopVal.staticUpdater: None
Expand Down Expand Up @@ -726,6 +726,7 @@ KeyboardComponent.store.allowedVals: ['last key', 'first key', 'all keys', 'noth
KeyboardComponent.store.allowedUpdates: []
KeyboardComponent.store.updates: constant
KeyboardComponent.store.valType: str
MicrophoneComponent.order: []
MicrophoneComponent.stereo.default: False
MicrophoneComponent.stereo.staticUpdater: None
MicrophoneComponent.stereo.val: False
Expand All @@ -740,7 +741,6 @@ MicrophoneComponent.name.val: mic_1
MicrophoneComponent.name.allowedTypes: []
MicrophoneComponent.name.allowedVals: []
MicrophoneComponent.name.allowedUpdates: None
MicrophoneComponent.name.updates: None
MicrophoneComponent.name.valType: code
MicrophoneComponent.stopVal.default: 2.0
MicrophoneComponent.stopVal.staticUpdater: None
Expand Down Expand Up @@ -790,13 +790,13 @@ MicrophoneComponent.startVal.allowedVals: []
MicrophoneComponent.startVal.allowedUpdates: None
MicrophoneComponent.startVal.updates: None
MicrophoneComponent.startVal.valType: code
MouseComponent.order: []
MouseComponent.name.default: mouse
MouseComponent.name.staticUpdater: None
MouseComponent.name.val: mouse
MouseComponent.name.allowedTypes: []
MouseComponent.name.allowedVals: []
MouseComponent.name.allowedUpdates: None
MouseComponent.name.updates: None
MouseComponent.name.valType: code
MouseComponent.timeRelativeTo.default: 'routine'
MouseComponent.timeRelativeTo.staticUpdater: None
Expand Down Expand Up @@ -870,6 +870,7 @@ MouseComponent.saveMouseState.allowedVals: ['final', 'on click', 'every frame',
MouseComponent.saveMouseState.allowedUpdates: None
MouseComponent.saveMouseState.updates: None
MouseComponent.saveMouseState.valType: str
MovieComponent.order: ['forceEndRoutine']
MovieComponent.opacity.default: 1
MovieComponent.opacity.staticUpdater: None
MovieComponent.opacity.val: 1
Expand All @@ -884,7 +885,6 @@ MovieComponent.name.val: movie
MovieComponent.name.allowedTypes: []
MovieComponent.name.allowedVals: []
MovieComponent.name.allowedUpdates: None
MovieComponent.name.updates: constant
MovieComponent.name.valType: code
MovieComponent.movie.default: ''
MovieComponent.movie.staticUpdater: None
Expand Down Expand Up @@ -982,13 +982,13 @@ MovieComponent.size.allowedVals: []
MovieComponent.size.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
MovieComponent.size.updates: constant
MovieComponent.size.valType: code
ParallelOutComponent.order: ['address', 'startData', 'stopData']
ParallelOutComponent.name.default: p_port
ParallelOutComponent.name.staticUpdater: None
ParallelOutComponent.name.val: p_port
ParallelOutComponent.name.allowedTypes: []
ParallelOutComponent.name.allowedVals: []
ParallelOutComponent.name.allowedUpdates: None
ParallelOutComponent.name.updates: None
ParallelOutComponent.name.valType: code
ParallelOutComponent.syncScreen.default: True
ParallelOutComponent.syncScreen.staticUpdater: None
Expand Down Expand Up @@ -1070,6 +1070,7 @@ ParallelOutComponent.startData.allowedVals: []
ParallelOutComponent.startData.allowedUpdates: None
ParallelOutComponent.startData.updates: None
ParallelOutComponent.startData.valType: code
PatchComponent.order: []
PatchComponent.opacity.default: 1
PatchComponent.opacity.staticUpdater: None
PatchComponent.opacity.val: 1
Expand All @@ -1092,7 +1093,6 @@ PatchComponent.name.val: patch
PatchComponent.name.allowedTypes: []
PatchComponent.name.allowedVals: []
PatchComponent.name.allowedUpdates: None
PatchComponent.name.updates: constant
PatchComponent.name.valType: code
PatchComponent.color.default: [1,1,1]
PatchComponent.color.staticUpdater: None
Expand Down Expand Up @@ -1230,6 +1230,7 @@ PatchComponent.size.allowedVals: []
PatchComponent.size.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
PatchComponent.size.updates: constant
PatchComponent.size.valType: code
PolygonComponent.order: ['nVertices']
PolygonComponent.opacity.default: 1
PolygonComponent.opacity.staticUpdater: None
PolygonComponent.opacity.val: 1
Expand All @@ -1252,7 +1253,6 @@ PolygonComponent.name.val: polygon
PolygonComponent.name.allowedTypes: []
PolygonComponent.name.allowedVals: []
PolygonComponent.name.allowedUpdates: None
PolygonComponent.name.updates: constant
PolygonComponent.name.valType: code
PolygonComponent.fillColor.default: [1,1,1]
PolygonComponent.fillColor.staticUpdater: None
Expand Down Expand Up @@ -1382,6 +1382,7 @@ PolygonComponent.size.allowedVals: []
PolygonComponent.size.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
PolygonComponent.size.updates: constant
PolygonComponent.size.valType: code
RatingScaleComponent.order: ['name', 'visualAnalogScale', 'categoryChoices', 'scaleDescription', 'low', 'high', 'labels', 'markerStart', 'size', 'pos', 'tickHeight']
RatingScaleComponent.labels.default: ''
RatingScaleComponent.labels.staticUpdater: None
RatingScaleComponent.labels.val:
Expand Down Expand Up @@ -1580,7 +1581,6 @@ RatingScaleComponent.name.val: rating
RatingScaleComponent.name.allowedTypes: []
RatingScaleComponent.name.allowedVals: []
RatingScaleComponent.name.allowedUpdates: None
RatingScaleComponent.name.updates: None
RatingScaleComponent.name.valType: code
RatingScaleComponent.singleClick.default: False
RatingScaleComponent.singleClick.staticUpdater: None
Expand All @@ -1590,6 +1590,7 @@ RatingScaleComponent.singleClick.allowedVals: []
RatingScaleComponent.singleClick.allowedUpdates: []
RatingScaleComponent.singleClick.updates: constant
RatingScaleComponent.singleClick.valType: bool
SettingsComponent.order: ['expName', 'Show info dlg', 'Experiment info', 'Data filename', 'Save excel file', 'Save csv file', 'Save wide csv file', 'Save psydat file', 'Save log file', 'logging level', 'Monitor', 'Screen', 'Full-screen window', 'Window size (pixels)', 'color', 'colorSpace', 'Units']
SettingsComponent.Show mouse.default: False
SettingsComponent.Show mouse.staticUpdater: None
SettingsComponent.Show mouse.val: False
Expand Down Expand Up @@ -1750,6 +1751,7 @@ SettingsComponent.Screen.allowedVals: []
SettingsComponent.Screen.allowedUpdates: None
SettingsComponent.Screen.updates: None
SettingsComponent.Screen.valType: num
SoundComponent.order: []
SoundComponent.sound.default: 'A'
SoundComponent.sound.staticUpdater: None
SoundComponent.sound.val: A
Expand All @@ -1772,7 +1774,6 @@ SoundComponent.name.val: sound_1
SoundComponent.name.allowedTypes: []
SoundComponent.name.allowedVals: []
SoundComponent.name.allowedUpdates: None
SoundComponent.name.updates: None
SoundComponent.name.valType: code
SoundComponent.stopVal.default: 1.0
SoundComponent.stopVal.staticUpdater: None
Expand Down Expand Up @@ -1822,6 +1823,7 @@ SoundComponent.startVal.allowedVals: []
SoundComponent.startVal.allowedUpdates: None
SoundComponent.startVal.updates: None
SoundComponent.startVal.valType: code
StaticComponent.order: ['name']
StaticComponent.code.default:
StaticComponent.code.staticUpdater: None
StaticComponent.code.val:
Expand All @@ -1836,7 +1838,6 @@ StaticComponent.name.val: ISI
StaticComponent.name.allowedTypes: []
StaticComponent.name.allowedVals: []
StaticComponent.name.allowedUpdates: None
StaticComponent.name.updates: None
StaticComponent.name.valType: code
StaticComponent.stopVal.default: 0.5
StaticComponent.stopVal.staticUpdater: None
Expand Down Expand Up @@ -1886,6 +1887,7 @@ StaticComponent.startVal.allowedVals: []
StaticComponent.startVal.allowedUpdates: None
StaticComponent.startVal.updates: None
StaticComponent.startVal.valType: code
TextComponent.order: []
TextComponent.opacity.default: 1
TextComponent.opacity.staticUpdater: None
TextComponent.opacity.val: 1
Expand All @@ -1908,7 +1910,6 @@ TextComponent.name.val: text
TextComponent.name.allowedTypes: []
TextComponent.name.allowedVals: []
TextComponent.name.allowedUpdates: None
TextComponent.name.updates: None
TextComponent.name.valType: code
TextComponent.wrapWidth.default:
TextComponent.wrapWidth.staticUpdater: None
Expand Down Expand Up @@ -2032,6 +2033,7 @@ TextComponent.letterHeight.allowedVals: []
TextComponent.letterHeight.allowedUpdates: ['constant', 'set every repeat', 'set every frame']
TextComponent.letterHeight.updates: constant
TextComponent.letterHeight.valType: code
cedrusButtonBoxComponent.order: ['forceEndRoutine', 'allowedKeys', 'store', 'storeCorrect', 'correctAns']
cedrusButtonBoxComponent.correctAns.default:
cedrusButtonBoxComponent.correctAns.staticUpdater: None
cedrusButtonBoxComponent.correctAns.val:
Expand All @@ -2054,7 +2056,6 @@ cedrusButtonBoxComponent.name.val: buttonBox
cedrusButtonBoxComponent.name.allowedTypes: []
cedrusButtonBoxComponent.name.allowedVals: []
cedrusButtonBoxComponent.name.allowedUpdates: None
cedrusButtonBoxComponent.name.updates: None
cedrusButtonBoxComponent.name.valType: code
cedrusButtonBoxComponent.deviceNumber.default: 0
cedrusButtonBoxComponent.deviceNumber.staticUpdater: None
Expand Down Expand Up @@ -2152,6 +2153,7 @@ cedrusButtonBoxComponent.store.allowedVals: ['last key', 'first key', 'all keys'
cedrusButtonBoxComponent.store.allowedUpdates: []
cedrusButtonBoxComponent.store.updates: constant
cedrusButtonBoxComponent.store.valType: str
ioLabsButtonBoxComponent.order: ['forceEndRoutine', 'active', 'lights', 'store', 'storeCorrect', 'correctAns']
ioLabsButtonBoxComponent.correctAns.default: '0'
ioLabsButtonBoxComponent.correctAns.staticUpdater: None
ioLabsButtonBoxComponent.correctAns.val: 0
Expand All @@ -2174,7 +2176,6 @@ ioLabsButtonBoxComponent.name.val: bbox
ioLabsButtonBoxComponent.name.allowedTypes: []
ioLabsButtonBoxComponent.name.allowedVals: []
ioLabsButtonBoxComponent.name.allowedUpdates: None
ioLabsButtonBoxComponent.name.updates: None
ioLabsButtonBoxComponent.name.valType: code
ioLabsButtonBoxComponent.discard previous.default: True
ioLabsButtonBoxComponent.discard previous.staticUpdater: None
Expand Down
14 changes: 13 additions & 1 deletion psychopy/tests/test_app/test_builder/x.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

if not '--out' in sys.argv:
target = open('x.out.master.de55d49', 'rU').read()
target = open('xo', 'rU').read()
targetLines = target.splitlines()
targetTag = {}
for line in targetLines:
Expand All @@ -48,7 +49,18 @@
# co = name only
c = allComp[co](parentName='x', exp=exp)

out = []
order = '%s.order: %s' % (co, eval("c.order"))
out = [order]
if '--out' in sys.argv:
print order
elif not order+'\n' in target:
tag = order.split(':',1)[0]
try:
err = order + ' <== ' + targetTag[tag]
except IndexError: # missing
err = order + ' <==> NEW (no matching param in original)'
print err
mismatches.append(err)
for p in c.params.keys():
# default is what you get from param.__str__, which returns its value
default = '%s.%s.default: %s' % (co, p, c.params[p])
Expand Down

0 comments on commit dc5a108

Please sign in to comment.