Check if Sphinx doc called the script

前端 未结 4 2128
予麋鹿
予麋鹿 2021-01-18 15:41

I am currently trying to generate sphinx documentation for scripts which use the ArcGIS arcpy library.

I am running into an issue when sphinx tries to run the scrip

4条回答
  •  一整个雨季
    2021-01-18 16:09

    The solution I came up with, while probably no-where near ideal, is to simply check

    if 'sphinx' in sys.modules:
        in_mxds = [r"C:/test.mxd"]
    else:
        in_mxds = arcpy.GetParameterAsText(1)
    

    This will ensure the script is not trying to get a parameter from the GUI which isn't set when generating sphinx documents.

提交回复
热议问题