Commits

Jason Scheirer committed 22c87b8

Reordered some parameter declaration stuff

Comments (0)

Files changed (1)

             yield "        param_{} = arcpy.Parameter()".format(idx + 1)
             yield "        param_{}.name = {}".format(idx + 1, repr(parameter.Name))
             yield "        param_{}.displayName = {}".format(idx + 1, repr(parameter.DisplayName))
+            yield "        param_{}.parameterType = {}".format(idx + 1, 
+                                                               repr(pytexportutils.esriGPParameterType.valueFor(parameter.ParameterType)
+                                                                                        [len('esriGPParameterType'):]))
             if (parameter.DataType.supports(pytexportutils.IGPMultiValueType.IID)):
                 yield "        param_{}.dataType = {}".format(idx + 1, repr(pytexportutils.IGPMultiValueType(parameter.DataType).MemberDataType.DisplayName))
                 yield "        param_{}.multiValue = True".format(idx + 1)
                 yield "        param_{}.columns = {}".format(idx + 1, repr(tablecols))
             else:
                 yield "        param_{}.dataType = {}".format(idx + 1, repr(parameter.DataType.DisplayName))
-            yield "        param_{}.parameterType = {}".format(idx + 1, 
-                                                               repr(pytexportutils.esriGPParameterType.valueFor(parameter.ParameterType)
-                                                                                        [len('esriGPParameterType'):]))
             # default value
             try:
                 value = parameter.Value.GetAsText()
 
 if __name__ == "__main__":
     import glob
-    for filename in [r'C:\SupportFiles\ArcGIS\ArcToolBox\Toolboxes\Spatial Statistics Tools.tbx']: #[r'Toolboxes\My Toolboxes\OutScript.tbx']:
+    #[r'C:\SupportFiles\ArcGIS\ArcToolBox\Toolboxes\Spatial Statistics Tools.tbx']: #[r'Toolboxes\My Toolboxes\OutScript.tbx']:
+    for filename in [os.path.join(os.path.dirname(os.path.abspath(__file__)), "dashboard.tbx")]:
         print HEADER_SOURCE
         print PYTToolbox(filename).python_code.encode("ascii", "replace")