We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Wrong link for polygon help button
Dear all,

The help button for the polygon dialog redirects to the wrong Web page:
http://www.psychopy.org/builder/components/shape.html

I guess it should now be:
http://www.psychopy.org/builder/components/polygon.html

I just updated to v1.81.02, so I guess the report is still relevant. I didn't check all the other buttons; I don't know which labels have been changed recently.

To be sure, I still included the output of sysInfo.py below.

Best,

Axel

Willkommen auf PsychoPy2!
v1.81.02

##### Running: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/sysInfo.py

Paths to files on the system:
    userPrefsFile: /Users/akohler/.psychopy2/userPrefs.cfg
    appDataFile: /Users/akohler/.psychopy2/appData.cfg
    demos: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos
    appFile: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/PsychoPy.py

System info:
Darwin-12.5.0-x86_64-i386-32bit
OS X 10.8.5 running on x86_64

Python info
/Applications/PsychoPy2.app/Contents/MacOS/python
2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:32:06) 
[GCC 4.0.1 (Apple Inc. build 5493)]
numpy 1.7.1
scipy 0.12.0
matplotlib 1.3.0
pyglet 1.1.4
pyo 0.6.6

PsychoPy 1.81.02
have shaders: True

OpenGL info:
vendor: Intel Inc.
rendering engine: Intel HD Graphics 3000 OpenGL Engine
OpenGL version: 2.1 INTEL-8.16.80
(Selected) Extensions:
    True GL_ARB_multitexture
    True GL_EXT_framebuffer_object
    True GL_ARB_fragment_program
    True GL_ARB_shader_objects
    True GL_ARB_vertex_shader
    True GL_ARB_texture_non_power_of_two
    True GL_ARB_texture_float
    False GL_STEREO
    max vertices in vertex array: 1048575
1.7780  WARNING     Movie2 stim could not be imported and won't be available
6.5262  WARNING     Monitor specification not found. Creating a temporary one...


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `psychopy/app/builder/components/polygon.py`
Content:
```
1 # Part of the PsychoPy library
2 # Copyright (C) 2014 Jonathan Peirce
3 # Distributed under the terms of the GNU General Public License (GPL).
4 
5 from _visual import * #to get the template visual component
6 from os import path
7 from psychopy.app.builder.components import getInitVals
8 
9 thisFolder = path.abspath(path.dirname(__file__))#the absolute path to the folder containing this path
10 iconFile = path.join(thisFolder,'polygon.png')
11 tooltip = _translate('Polygon: any regular polygon (line, triangle, square...circle)')
12 
13 # only use _localized values for label values, nothing functional:
14 _localized = {'nVertices': _translate('Num. vertices'),
15               'fillColorSpace': _translate('Fill color-space'), 'fillColor': _translate('Fill color'),
16               'lineColorSpace': _translate('Line color-space'), 'lineColor': _translate('Line color'),
17               'lineWidth': _translate('Line width'),
18               'interpolate': _translate('Interpolate'), 'size': _translate("Size [w,h]")
19               }
20 
21 class PolygonComponent(VisualComponent):
22     """A class for presenting grating stimuli"""
23     def __init__(self, exp, parentName, name='polygon', interpolate='linear',
24                 units='from exp settings',
25                 lineColor='$[1,1,1]', lineColorSpace='rgb', lineWidth=1,
26                 fillColor='$[1,1,1]', fillColorSpace='rgb',
27                 nVertices=4,
28                 pos=[0,0], size=[0.5,0.5], ori=0,
29                 startType='time (s)', startVal=0.0,
30                 stopType='duration (s)', stopVal=1.0,
31                 startEstim='', durationEstim=''):
32         #initialise main parameters from base stimulus
33         super(PolygonComponent, self).__init__(exp,parentName,name=name, units=units,
34                     pos=pos, size=size, ori=ori,
35                     startType=startType, startVal=startVal,
36                     stopType=stopType, stopVal=stopVal,
37                     startEstim=startEstim, durationEstim=durationEstim)
38         self.type='Polygon'
39         self.url="http://www.psychopy.org/builder/components/shape.html"
40         self.exp.requirePsychopyLibs(['visual'])
41         self.order=['nVertices']
42         #params
43         self.params['nVertices']=Param(nVertices, valType='int',
44             updates='constant', allowedUpdates=['constant'],
45             hint=_translate("How many vertices? 2=line, 3=triangle... (90 approximates a circle)"),
46             label=_localized['nVertices'])
47         self.params['fillColorSpace']=Param(fillColorSpace, valType='str', allowedVals=['rgb','dkl','lms','hsv'],
48             updates='constant',
49             hint=_translate("Choice of color space for the fill color (rgb, dkl, lms, hsv)"),
50             label=_localized['fillColorSpace'], categ='Advanced')
51         self.params['fillColor']=Param(fillColor, valType='str', allowedTypes=[],
52             updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],
53             hint=_translate("Fill color of this shape; Right-click to bring up a color-picker (rgb only)"),
54             label=_localized['fillColor'], categ='Advanced')
55         self.params['lineColorSpace']=Param(lineColorSpace, valType='str', allowedVals=['rgb','dkl','lms','hsv'],
56             updates='constant',
57             hint=_translate("Choice of color space for the fill color (rgb, dkl, lms, hsv)"),
58             label=_localized['lineColorSpace'], categ='Advanced')
59         self.params['lineColor']=Param(lineColor, valType='str', allowedTypes=[],
60             updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],
61             hint=_translate("Line color of this shape; Right-click to bring up a color-picker (rgb only)"),
62             label=_localized['lineColor'], categ='Advanced')
63         self.params['lineWidth']=Param(lineWidth, valType='code', allowedTypes=[],
64             updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],
65             hint=_translate("Width of the shape's line (always in pixels - this does NOT use 'units')"),
66             label=_localized['lineWidth'])
67         self.params['interpolate']=Param(interpolate, valType='str', allowedVals=['linear','nearest'],
68             updates='constant', allowedUpdates=[],
69             hint=_translate("How should the image be interpolated if/when rescaled"),
70             label=_localized['interpolate'], categ='Advanced')
71         self.params['size']=Param(size, valType='code', allowedTypes=[],
72             updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],
73             hint=_translate("Size of this stimulus [w,h]. Note that for a line only the first value is used, for triangle and rect the [w,h] is as expected,\n but for higher-order polygons it represents the [w,h] of the ellipse that the polygon sits on!! "),
74             label=_localized['size'])
75         del self.params['color']
76         del self.params['colorSpace']
77 
78     def writeInitCode(self,buff):
79         #do we need units code?
80         if self.params['units'].val=='from exp settings': unitsStr=""
81         else: unitsStr="units=%(units)s, " %self.params
82         inits = getInitVals(self.params)#replaces variable params with defaults
83         if inits['size'].val=='1.0':
84             inits['size'].val = '[1.0, 1.0]'
85         if self.params['nVertices'].val == '2':
86             buff.writeIndented("%s = visual.Line(win=win, name='%s',%s\n" %(inits['name'],inits['name'],unitsStr))
87             buff.writeIndented("    start=(-%(size)s[0]/2.0, 0), end=(+%(size)s[0]/2.0, 0),\n" %(inits) )
88         elif self.params['nVertices'].val == '3':
89             buff.writeIndented("%s = visual.ShapeStim(win=win, name='%s',%s\n" %(inits['name'],inits['name'],unitsStr))
90             buff.writeIndented("    vertices = [[-%(size)s[0]/2.0,-%(size)s[1]/2.0], [+%(size)s[0]/2.0,-%(size)s[1]/2.0], [0,%(size)s[1]/2.0]],\n" %(inits) )
91         elif self.params['nVertices'].val == '4':
92             buff.writeIndented("%s = visual.Rect(win=win, name='%s',%s\n" %(inits['name'],inits['name'],unitsStr))
93             buff.writeIndented("    width=%(size)s[0], height=%(size)s[1],\n" %(inits) )
94         else:
95             buff.writeIndented("%s = visual.Polygon(win=win, name='%s',%s\n" %(inits['name'],inits['name'],unitsStr))
96             buff.writeIndented("    edges = %s," % str(inits['nVertices'].val))
97             buff.writeIndented(" size=%(size)s,\n" %(inits) )
98         buff.writeIndented("    ori=%(ori)s, pos=%(pos)s,\n" %(inits) )
99         buff.writeIndented("    lineWidth=%(lineWidth)s, lineColor=%(lineColor)s, lineColorSpace=%(lineColorSpace)s,\n" %(inits) )
100         buff.writeIndented("    fillColor=%(fillColor)s, fillColorSpace=%(fillColorSpace)s,\n" %(inits) )
101         buff.writeIndented("    opacity=%(opacity)s," %(inits) )
102         if self.params['interpolate'].val=='linear':
103             buff.write("interpolate=True)\n")
104         else: buff.write("interpolate=False)\n")
105
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/psychopy/app/builder/components/polygon.py b/psychopy/app/builder/components/polygon.py
--- a/psychopy/app/builder/components/polygon.py
+++ b/psychopy/app/builder/components/polygon.py
@@ -36,7 +36,7 @@
                     stopType=stopType, stopVal=stopVal,
                     startEstim=startEstim, durationEstim=durationEstim)
         self.type='Polygon'
-        self.url="http://www.psychopy.org/builder/components/shape.html"
+        self.url="http://www.psychopy.org/builder/components/polygon.html"
         self.exp.requirePsychopyLibs(['visual'])
         self.order=['nVertices']
         #params

{"golden_diff": "diff --git a/psychopy/app/builder/components/polygon.py b/psychopy/app/builder/components/polygon.py\n--- a/psychopy/app/builder/components/polygon.py\n+++ b/psychopy/app/builder/components/polygon.py\n@@ -36,7 +36,7 @@\n                     stopType=stopType, stopVal=stopVal,\n                     startEstim=startEstim, durationEstim=durationEstim)\n         self.type='Polygon'\n-        self.url=\"http://www.psychopy.org/builder/components/shape.html\"\n+        self.url=\"http://www.psychopy.org/builder/components/polygon.html\"\n         self.exp.requirePsychopyLibs(['visual'])\n         self.order=['nVertices']\n         #params\n", "issue": "Wrong link for polygon help button\nDear all,\n\nThe help button for the polygon dialog redirects to the wrong Web page:\nhttp://www.psychopy.org/builder/components/shape.html\n\nI guess it should now be:\nhttp://www.psychopy.org/builder/components/polygon.html\n\nI just updated to v1.81.02, so I guess the report is still relevant. I didn't check all the other buttons; I don't know which labels have been changed recently.\n\nTo be sure, I still included the output of sysInfo.py below.\n\nBest,\n\nAxel\n\nWillkommen auf PsychoPy2!\nv1.81.02\n\u001b\n##### Running: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/sysInfo.py\n\nPaths to files on the system:\n    userPrefsFile: /Users/akohler/.psychopy2/userPrefs.cfg\n    appDataFile: /Users/akohler/.psychopy2/appData.cfg\n    demos: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos\n    appFile: /Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/app/PsychoPy.py\n\nSystem info:\nDarwin-12.5.0-x86_64-i386-32bit\nOS X 10.8.5 running on x86_64\n\nPython info\n/Applications/PsychoPy2.app/Contents/MacOS/python\n2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:32:06) \n[GCC 4.0.1 (Apple Inc. build 5493)]\nnumpy 1.7.1\nscipy 0.12.0\nmatplotlib 1.3.0\npyglet 1.1.4\npyo 0.6.6\n\nPsychoPy 1.81.02\nhave shaders: True\n\nOpenGL info:\nvendor: Intel Inc.\nrendering engine: Intel HD Graphics 3000 OpenGL Engine\nOpenGL version: 2.1 INTEL-8.16.80\n(Selected) Extensions:\n    True GL_ARB_multitexture\n    True GL_EXT_framebuffer_object\n    True GL_ARB_fragment_program\n    True GL_ARB_shader_objects\n    True GL_ARB_vertex_shader\n    True GL_ARB_texture_non_power_of_two\n    True GL_ARB_texture_float\n    False GL_STEREO\n    max vertices in vertex array: 1048575\n1.7780  WARNING     Movie2 stim could not be imported and won't be available\n6.5262  WARNING     Monitor specification not found. Creating a temporary one...\n\n", "before_files": [{"content": "# Part of the PsychoPy library\n# Copyright (C) 2014 Jonathan Peirce\n# Distributed under the terms of the GNU General Public License (GPL).\n\nfrom _visual import * #to get the template visual component\nfrom os import path\nfrom psychopy.app.builder.components import getInitVals\n\nthisFolder = path.abspath(path.dirname(__file__))#the absolute path to the folder containing this path\niconFile = path.join(thisFolder,'polygon.png')\ntooltip = _translate('Polygon: any regular polygon (line, triangle, square...circle)')\n\n# only use _localized values for label values, nothing functional:\n_localized = {'nVertices': _translate('Num. vertices'),\n              'fillColorSpace': _translate('Fill color-space'), 'fillColor': _translate('Fill color'),\n              'lineColorSpace': _translate('Line color-space'), 'lineColor': _translate('Line color'),\n              'lineWidth': _translate('Line width'),\n              'interpolate': _translate('Interpolate'), 'size': _translate(\"Size [w,h]\")\n              }\n\nclass PolygonComponent(VisualComponent):\n    \"\"\"A class for presenting grating stimuli\"\"\"\n    def __init__(self, exp, parentName, name='polygon', interpolate='linear',\n                units='from exp settings',\n                lineColor='$[1,1,1]', lineColorSpace='rgb', lineWidth=1,\n                fillColor='$[1,1,1]', fillColorSpace='rgb',\n                nVertices=4,\n                pos=[0,0], size=[0.5,0.5], ori=0,\n                startType='time (s)', startVal=0.0,\n                stopType='duration (s)', stopVal=1.0,\n                startEstim='', durationEstim=''):\n        #initialise main parameters from base stimulus\n        super(PolygonComponent, self).__init__(exp,parentName,name=name, units=units,\n                    pos=pos, size=size, ori=ori,\n                    startType=startType, startVal=startVal,\n                    stopType=stopType, stopVal=stopVal,\n                    startEstim=startEstim, durationEstim=durationEstim)\n        self.type='Polygon'\n        self.url=\"http://www.psychopy.org/builder/components/shape.html\"\n        self.exp.requirePsychopyLibs(['visual'])\n        self.order=['nVertices']\n        #params\n        self.params['nVertices']=Param(nVertices, valType='int',\n            updates='constant', allowedUpdates=['constant'],\n            hint=_translate(\"How many vertices? 2=line, 3=triangle... (90 approximates a circle)\"),\n            label=_localized['nVertices'])\n        self.params['fillColorSpace']=Param(fillColorSpace, valType='str', allowedVals=['rgb','dkl','lms','hsv'],\n            updates='constant',\n            hint=_translate(\"Choice of color space for the fill color (rgb, dkl, lms, hsv)\"),\n            label=_localized['fillColorSpace'], categ='Advanced')\n        self.params['fillColor']=Param(fillColor, valType='str', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Fill color of this shape; Right-click to bring up a color-picker (rgb only)\"),\n            label=_localized['fillColor'], categ='Advanced')\n        self.params['lineColorSpace']=Param(lineColorSpace, valType='str', allowedVals=['rgb','dkl','lms','hsv'],\n            updates='constant',\n            hint=_translate(\"Choice of color space for the fill color (rgb, dkl, lms, hsv)\"),\n            label=_localized['lineColorSpace'], categ='Advanced')\n        self.params['lineColor']=Param(lineColor, valType='str', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Line color of this shape; Right-click to bring up a color-picker (rgb only)\"),\n            label=_localized['lineColor'], categ='Advanced')\n        self.params['lineWidth']=Param(lineWidth, valType='code', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Width of the shape's line (always in pixels - this does NOT use 'units')\"),\n            label=_localized['lineWidth'])\n        self.params['interpolate']=Param(interpolate, valType='str', allowedVals=['linear','nearest'],\n            updates='constant', allowedUpdates=[],\n            hint=_translate(\"How should the image be interpolated if/when rescaled\"),\n            label=_localized['interpolate'], categ='Advanced')\n        self.params['size']=Param(size, valType='code', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Size of this stimulus [w,h]. Note that for a line only the first value is used, for triangle and rect the [w,h] is as expected,\\n but for higher-order polygons it represents the [w,h] of the ellipse that the polygon sits on!! \"),\n            label=_localized['size'])\n        del self.params['color']\n        del self.params['colorSpace']\n\n    def writeInitCode(self,buff):\n        #do we need units code?\n        if self.params['units'].val=='from exp settings': unitsStr=\"\"\n        else: unitsStr=\"units=%(units)s, \" %self.params\n        inits = getInitVals(self.params)#replaces variable params with defaults\n        if inits['size'].val=='1.0':\n            inits['size'].val = '[1.0, 1.0]'\n        if self.params['nVertices'].val == '2':\n            buff.writeIndented(\"%s = visual.Line(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    start=(-%(size)s[0]/2.0, 0), end=(+%(size)s[0]/2.0, 0),\\n\" %(inits) )\n        elif self.params['nVertices'].val == '3':\n            buff.writeIndented(\"%s = visual.ShapeStim(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    vertices = [[-%(size)s[0]/2.0,-%(size)s[1]/2.0], [+%(size)s[0]/2.0,-%(size)s[1]/2.0], [0,%(size)s[1]/2.0]],\\n\" %(inits) )\n        elif self.params['nVertices'].val == '4':\n            buff.writeIndented(\"%s = visual.Rect(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    width=%(size)s[0], height=%(size)s[1],\\n\" %(inits) )\n        else:\n            buff.writeIndented(\"%s = visual.Polygon(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    edges = %s,\" % str(inits['nVertices'].val))\n            buff.writeIndented(\" size=%(size)s,\\n\" %(inits) )\n        buff.writeIndented(\"    ori=%(ori)s, pos=%(pos)s,\\n\" %(inits) )\n        buff.writeIndented(\"    lineWidth=%(lineWidth)s, lineColor=%(lineColor)s, lineColorSpace=%(lineColorSpace)s,\\n\" %(inits) )\n        buff.writeIndented(\"    fillColor=%(fillColor)s, fillColorSpace=%(fillColorSpace)s,\\n\" %(inits) )\n        buff.writeIndented(\"    opacity=%(opacity)s,\" %(inits) )\n        if self.params['interpolate'].val=='linear':\n            buff.write(\"interpolate=True)\\n\")\n        else: buff.write(\"interpolate=False)\\n\")\n", "path": "psychopy/app/builder/components/polygon.py"}], "after_files": [{"content": "# Part of the PsychoPy library\n# Copyright (C) 2014 Jonathan Peirce\n# Distributed under the terms of the GNU General Public License (GPL).\n\nfrom _visual import * #to get the template visual component\nfrom os import path\nfrom psychopy.app.builder.components import getInitVals\n\nthisFolder = path.abspath(path.dirname(__file__))#the absolute path to the folder containing this path\niconFile = path.join(thisFolder,'polygon.png')\ntooltip = _translate('Polygon: any regular polygon (line, triangle, square...circle)')\n\n# only use _localized values for label values, nothing functional:\n_localized = {'nVertices': _translate('Num. vertices'),\n              'fillColorSpace': _translate('Fill color-space'), 'fillColor': _translate('Fill color'),\n              'lineColorSpace': _translate('Line color-space'), 'lineColor': _translate('Line color'),\n              'lineWidth': _translate('Line width'),\n              'interpolate': _translate('Interpolate'), 'size': _translate(\"Size [w,h]\")\n              }\n\nclass PolygonComponent(VisualComponent):\n    \"\"\"A class for presenting grating stimuli\"\"\"\n    def __init__(self, exp, parentName, name='polygon', interpolate='linear',\n                units='from exp settings',\n                lineColor='$[1,1,1]', lineColorSpace='rgb', lineWidth=1,\n                fillColor='$[1,1,1]', fillColorSpace='rgb',\n                nVertices=4,\n                pos=[0,0], size=[0.5,0.5], ori=0,\n                startType='time (s)', startVal=0.0,\n                stopType='duration (s)', stopVal=1.0,\n                startEstim='', durationEstim=''):\n        #initialise main parameters from base stimulus\n        super(PolygonComponent, self).__init__(exp,parentName,name=name, units=units,\n                    pos=pos, size=size, ori=ori,\n                    startType=startType, startVal=startVal,\n                    stopType=stopType, stopVal=stopVal,\n                    startEstim=startEstim, durationEstim=durationEstim)\n        self.type='Polygon'\n        self.url=\"http://www.psychopy.org/builder/components/polygon.html\"\n        self.exp.requirePsychopyLibs(['visual'])\n        self.order=['nVertices']\n        #params\n        self.params['nVertices']=Param(nVertices, valType='int',\n            updates='constant', allowedUpdates=['constant'],\n            hint=_translate(\"How many vertices? 2=line, 3=triangle... (90 approximates a circle)\"),\n            label=_localized['nVertices'])\n        self.params['fillColorSpace']=Param(fillColorSpace, valType='str', allowedVals=['rgb','dkl','lms','hsv'],\n            updates='constant',\n            hint=_translate(\"Choice of color space for the fill color (rgb, dkl, lms, hsv)\"),\n            label=_localized['fillColorSpace'], categ='Advanced')\n        self.params['fillColor']=Param(fillColor, valType='str', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Fill color of this shape; Right-click to bring up a color-picker (rgb only)\"),\n            label=_localized['fillColor'], categ='Advanced')\n        self.params['lineColorSpace']=Param(lineColorSpace, valType='str', allowedVals=['rgb','dkl','lms','hsv'],\n            updates='constant',\n            hint=_translate(\"Choice of color space for the fill color (rgb, dkl, lms, hsv)\"),\n            label=_localized['lineColorSpace'], categ='Advanced')\n        self.params['lineColor']=Param(lineColor, valType='str', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Line color of this shape; Right-click to bring up a color-picker (rgb only)\"),\n            label=_localized['lineColor'], categ='Advanced')\n        self.params['lineWidth']=Param(lineWidth, valType='code', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Width of the shape's line (always in pixels - this does NOT use 'units')\"),\n            label=_localized['lineWidth'])\n        self.params['interpolate']=Param(interpolate, valType='str', allowedVals=['linear','nearest'],\n            updates='constant', allowedUpdates=[],\n            hint=_translate(\"How should the image be interpolated if/when rescaled\"),\n            label=_localized['interpolate'], categ='Advanced')\n        self.params['size']=Param(size, valType='code', allowedTypes=[],\n            updates='constant', allowedUpdates=['constant','set every repeat','set every frame'],\n            hint=_translate(\"Size of this stimulus [w,h]. Note that for a line only the first value is used, for triangle and rect the [w,h] is as expected,\\n but for higher-order polygons it represents the [w,h] of the ellipse that the polygon sits on!! \"),\n            label=_localized['size'])\n        del self.params['color']\n        del self.params['colorSpace']\n\n    def writeInitCode(self,buff):\n        #do we need units code?\n        if self.params['units'].val=='from exp settings': unitsStr=\"\"\n        else: unitsStr=\"units=%(units)s, \" %self.params\n        inits = getInitVals(self.params)#replaces variable params with defaults\n        if inits['size'].val=='1.0':\n            inits['size'].val = '[1.0, 1.0]'\n        if self.params['nVertices'].val == '2':\n            buff.writeIndented(\"%s = visual.Line(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    start=(-%(size)s[0]/2.0, 0), end=(+%(size)s[0]/2.0, 0),\\n\" %(inits) )\n        elif self.params['nVertices'].val == '3':\n            buff.writeIndented(\"%s = visual.ShapeStim(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    vertices = [[-%(size)s[0]/2.0,-%(size)s[1]/2.0], [+%(size)s[0]/2.0,-%(size)s[1]/2.0], [0,%(size)s[1]/2.0]],\\n\" %(inits) )\n        elif self.params['nVertices'].val == '4':\n            buff.writeIndented(\"%s = visual.Rect(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    width=%(size)s[0], height=%(size)s[1],\\n\" %(inits) )\n        else:\n            buff.writeIndented(\"%s = visual.Polygon(win=win, name='%s',%s\\n\" %(inits['name'],inits['name'],unitsStr))\n            buff.writeIndented(\"    edges = %s,\" % str(inits['nVertices'].val))\n            buff.writeIndented(\" size=%(size)s,\\n\" %(inits) )\n        buff.writeIndented(\"    ori=%(ori)s, pos=%(pos)s,\\n\" %(inits) )\n        buff.writeIndented(\"    lineWidth=%(lineWidth)s, lineColor=%(lineColor)s, lineColorSpace=%(lineColorSpace)s,\\n\" %(inits) )\n        buff.writeIndented(\"    fillColor=%(fillColor)s, fillColorSpace=%(fillColorSpace)s,\\n\" %(inits) )\n        buff.writeIndented(\"    opacity=%(opacity)s,\" %(inits) )\n        if self.params['interpolate'].val=='linear':\n            buff.write(\"interpolate=True)\\n\")\n        else: buff.write(\"interpolate=False)\\n\")\n", "path": "psychopy/app/builder/components/polygon.py"}]}