Select to view content in your preferred language

ERROR 001242 when calling arcpy.CreateGPSDDraft with result from .pyt toolbox

3644
6
02-19-2014 12:47 PM
CharlesArnold
Deactivated User
I am unable to successfully call arcpy.CreateGPSDDraft with a result object from a tool that's defined in a python toolbox. 

I always get the following error:

 
  rl = [tool() for tool in tools] # calls each tool and stores the result objects in "rl"
    arcpy.CreateGPSDDraft(rl, r'S:\source\git\testpyt\test_gp_create.sddraft', 'test_gp')
    Out[4]:
    {'errors': {(u'ERROR 001242: Tool test1 is missing item description summary',
       80): [],
      (u'ERROR 001242: Tool test2 is missing item description summary', 80): [],
      (u'ERROR 001242: Tool test3 is missing item description summary',
       80): [], ..


Anyone had any success with this?
Tags (2)
0 Kudos
6 Replies
NidhinKarthikeyan
Honored Contributor
Tool Error: 001242 states that, the task is missing the required summary in the Item Description. Provide a summary in Item Description.
0 Kudos
CharlesArnold
Deactivated User
Tool Error: 001242 states that, the task is missing the required summary in the Item Description. Provide a summary in Item Description.


I understand the error message; when I'm publishing from within ArcMap, I can simply double click the error message and provide the description.  I want to create a script that will create the .sd file from the .pyt file without me having to do a bunch of repetitive clicking around in the UI.  I assume that's what the arcpy.CreateGPSDDraft function is for, but I haven't been able to get it to work with a .pyt toolbox.
0 Kudos
KevinHibma
Esri Regular Contributor
These values must be filled in on the Item Description page from within ArcMap or ArcCatalog:
http://resources.arcgis.com/en/help/main/10.1/index.html#/Documenting_a_tool_in_a_Python_toolbox/001...

We haven't got much push or request to implement a 100% python solution for doc'ing Python Toolboxes. You could post an idea on http://ideas.arcgis.com if you'd like to see this considered.
0 Kudos
CharlesArnold
Deactivated User
These values must be filled in on the Item Description page from within ArcMap or ArcCatalog:
http://resources.arcgis.com/en/help/main/10.1/index.html#/Documenting_a_tool_in_a_Python_toolbox/001...

We haven't got much push or request to implement a 100% python solution for doc'ing Python Toolboxes. You could post an idea on http://ideas.arcgis.com if you'd like to see this considered.


Maybe ESRI can add a note in the documentation for the arcpy.CreateGPSDDraft function (http://resources.arcgis.com/en/help/main/10.1/index.html#//018v0000008z000000) that it only works with .tbx toolboxes, and there's no way to get it to work with python toolboxes?  Would have saved me some time digging thru documentation to find what I was missing, only to end up empty.

Or maybe the descriptions can just be made optional?  A warning would be great, but making it an error to not have parameter descriptions is treating your users like children.

Editing the XML files that contain the "descriptions" from the script that calls arcpy.CreateGPSDDraft is easy enough, but the format of those files doesn't appear to be documented anywhere.  It's human readable XML tho, so I was able to figure it out without documentation; a simple script that works for me is at https://gist.github.com/cwa-/9191377 ..
AlanStewart
Frequent Contributor

I have exactly the same problem, but the provided link does not work for me.

0 Kudos
OttarValvåg
Esri Contributor

Edit the ToolboxName.ToolName.pyt.xml file

Format the xml

Locate the <tool name="ToolName" displayname="ToolName" toolboxalias=""> tag

add a child tag <summary>My summary</summary>.

 
0 Kudos