Original User: johnmdyeI wrote a Python Toolbox tool to take a bunch of LPKs, unpack them and then update a layer directory and target Geodatabase. I identify the LPK and which FC and Layer File it should be updating based on the LPK name. I used the arcpy.Describe object to get the name and then run a series of if/elif/else statements to test for the name and then once a match is found, update the target layer files and feature classes. My IDE of choice (PyScripter) however seems to be telling me that the indent for my elif shouldn't be there.I'm posting the code as well as several screen shots to illustrate my problem.PyScripter:[ATTACH=CONFIG]28349[/ATTACH]As you can see, PyScripter is saying that at line 189, something is wrong. A quick syntax check tells me its an offset error, but the elif statement is inline with the original if statement. It didn't show this until I added the comment directly above. If I remove it, the error goes away.[ATTACH=CONFIG]28350[/ATTACH]Anyone know why this would be?# For each Layer Package the user has provided for LPK in LPK_list: # Extract the Layer Package Metadata and store it in the variable 'desc' desc = arcpy.Describe(LPK) # Extract the name of the Layer Package from the Metadata and store it in the variable 'name' name = desc.name """If the 'name' is 'COF_Branches':""" if name == "COF_Branches.lpk": """Establish the Target Name""" TargetName = "COF_Branches" """Establish the Feature Dataset name""" FD = "Branches" # Unpack the Layer Package to the srcExtractDir arcpy.ExtractPackage(LPK, srcExtractDir) # Acquire the Source Layer File from the srcExtractFolder srcLYRFile = srcExtractFolder + "\\0000" + str(TargetName) + ".lyr" # Validate that the Layer File was acquired, raising a Fatal Error if the Layer File acquisition was unsuccessful if arcpy.Exists(srcLYRFile) == False: arcpy.AddError("An error occured while unpacking '" + str(name) + "'. The result Layer File could not be acquired. \ Unable to continue. Contact GIS Manager.") # Rename the Source Layer File to match the existing naming convention arcpy.Rename_management(srcLYRFile, str(TargetName) + ".lyr") # Reacquire the Source Layer File with the updated name, this time instantiating it as a Layer object srcLYRFile = arcpy.mapping.Layer(srcExtractFolder + "\\" + str(TargetName) + ".lyr") # Validate that the Layer File was reacquired, raising a Fatal Error if the Layer File acquisition was unsuccessful if arcpy.Exists(srcLYRFile) == False: arcpy.AddError("An error occured while reacquiring the updated source Layer File. '" + str(srcLYRFile) + "' could not \ be reacquired. Unable to continue. Contact GIS Manager.") # Acquire the MXDs Target Feature Layer to update try: FeatureLayer = arcpy.mapping.Layer('"' + str(TargetName) + '"') except: arcpy.AddError("An error occured while trying to acquire the Map Layer. '" + str(FeatureLayer) + "' could not be \ acquired. Unable to continue. Contact GIS Manager.") # Update the MXD's Feature Layer to reference the source Layer File ## This step is performed so that the 'tgtFC' which is to be updated with the 'srcFC', can be deleted from disk, ## while bypassing the automatic RemoveLayer() event that would occur in ArcMap if the 'srcFC' referenced by the ## MXD's 'FeatureLayer' were to be deleted while the 'FeatureLayer' is still referencing the 'srcFC'. arcpy.mapping.UpdateLayer(df, FeatureLayer, srcLYRFile, False) """ Update the Source Data """ # Acquire the Source Feature Class srcFC = srcExtractGDB + "\\" + str(FD) + "\\" + str(TargetName) # Validate that the Source Feature Class was acquired, raising a Fatal Error if the Feature Class acquisition was unsuccessful if arcpy.Exists(srcFC) == False: arcpy.AddError("An error occured while acquiring the source Feature Class. '" + str(srcFC) + "' could not be acquired. Unable to continue. Contact GIS Manager.") # Acquire the Target Feature Class tgtFC = tgtGDB + "\\" + str(FD) + "\\" + str(TargetName) # Validate that the Target Feature Class was acquired, raising a Fatal Error if the Feature Class acquisition was unsuccessful if arcpy.Exists(tgtFC) == False: arcpy.AddError("An error occured while acquiring the target Feature Class. '" + str(tgtFC) + "' could not be acquired. Unable to continue. Contact GIS Manager.") # Delete the Target Feature Class from Disk arcpy.Delete_management(tgtFC) # Import the Source Feature Class into the Target Geodatabase, keeping the same name arcpy.FeatureClasstoGeodatabase_conversion(srcFC, tgtGDB + "\\" + str(FD)) # Reacquire the MXD's Feature Layer FeatureLayer = arcpy.mapping.Layer('"' + str(TargetName) + '"') # Update the MXD Feature Layer's Data Source FeatureLayer.replaceDataSource(str(tgtGDB), "FILEGDB_WORKSPACE", '"' + str(TargetName) + '"', True) # Save the Feature Layer to a Layer File, overwriting the existing target Layer File arcpy.SaveToLayerFile_management(FeatureLayer, tgtDIR + "\\" + str(TargetName) + ".lyr", "RELATIVE") """Cleanup""" # Delete the extraction folder arcpy.Delete_management(srcExtractDir) """If the name is 'COF_ATMs':""" elif name == "COF_ATMs": """Establish the Target Name""" TargetName = "COF_ATMs"