def copy_if_out_of_date(original, derived):
 if ((not os.path.exists(derived)) or (os.stat(derived).st_mtime < os.stat(original).st_mtime)):
  try:
   shutil.copyfile(original, derived)
  except IOError:
   if (os.path.basename(original) == 'matplotlibrc'):
    msg = (("'%s' not found. " % original) + 'Did you run `python setup.py build`?')
    raise IOError(msg)
   else:
    raise

def copy_if_out_of_date ( original , derived ) : if ( ( not os . path . exists ( derived ) ) or ( os . stat ( derived ) . st_mtime < os . stat ( original ) . st_mtime ) ) : try : shutil . copyfile ( original , derived ) except IOError : if ( os . path . basename ( original ) == 'matplotlibrc' ) : msg = ( ( "'%s' not found. " % original ) + 'Did you run `python setup.py build`?' ) raise IOError ( msg ) else : raise
copy file only if newer as target or if target does not exist .