# ---------------------------------------------------------------------------
# Chapter8_1_IdentifyBrokenLinks.py
# Created by Silas Toms
# 2014 04 23
# ---------------------------------------------------------------------------


import arcpy, os

mxdPath = 'C:\Projects\MXDs\Chapter8\BrokenLinks.mxd'
mxdObject = arcpy.mapping.MapDocument(mxdPath)
brokenLinks = arcpy.mapping.ListBrokenDataSources(mxdObject)
for link in brokenLinks:
    print link.name, link.dataSource

oldPath = r'C:\Projects\MXDs\Data'
newPath = r'C:\Projects\MXDs\NewData'
mxdObject.findAndReplaceWorkspacePaths(oldPath,newPath)
mxdObject.save()


