This would be easier to read with an if else instead of a reassignment

if matching...
 p = os.path.join(source_path, matched...
else
 p = source_path

And should these be elseifs?