We have an internal python script that generates MXD and PDF outputs from templates we have created. The original templates were very basic and only featured the World Imagery Basemap and Points that have geometric corrections applied during the script.
Currently, we are undergoing efforts to improve these templates with additional authoritative layers. Such as: the USGS Geology. We created a new template and added this layer. But, the script is now failing to provide an output. It also doesn't produce an error when run from Idle.
We are concerned it may be with the top section of the script which can be seen below:
import os,os.path, math, sys
from arcpy import env
from arcpy import mapping
arcpy.env.overwriteOutput = True
arcpy.env.addOutputsToMap = True
maplayers =  # ["SGMC_Geology"]
But, this other section also looks like it could be causing some trouble:
def loopThruMapDocs(map_templates_folder, projectnumber,maplayers):
for root, dirs, files in os.walk(map_templates_folder):
for mxd in files:
mapdoc = mxd
filterByProject(projectnumber, mapdoc, map_templates_folder, maplayers)
def loopThruMapLayers(mapdocument, dataframe, projectnumber):
maplayers = arcpy.mapping.ListLayers(mapdocument,"SGMC_Geology*", dataframe)
Does anyone have any thoughts on this? Any input would be truly helpful.