def build_alert_hooks_from_path(patterns_path, warnfile):
 (dirname, basename) = os.path.split(patterns_path)
 site_overrides_basename = (('site_' + basename) + '_overrides')
 site_overrides_path = os.path.join(dirname, site_overrides_basename)
 site_overrides_file = None
 patterns_file = open(patterns_path)
 try:
  if os.path.exists(site_overrides_path):
   site_overrides_file = open(site_overrides_path)
  try:
   return build_alert_hooks(patterns_file, warnfile, overrides_file=site_overrides_file)
  finally:
   if site_overrides_file:
    site_overrides_file.close()
 finally:
  patterns_file.close()

def build_alert_hooks_from_path ( patterns_path , warnfile ) : ( dirname , basename ) = os . path . split ( patterns_path ) site_overrides_basename = ( ( 'site_' + basename ) + '_overrides' ) site_overrides_path = os . path . join ( dirname , site_overrides_basename ) site_overrides_file = None patterns_file = open ( patterns_path ) try : if os . path . exists ( site_overrides_path ) : site_overrides_file = open ( site_overrides_path ) try : return build_alert_hooks ( patterns_file , warnfile , overrides_file = site_overrides_file ) finally : if site_overrides_file : site_overrides_file . close ( ) finally : patterns_file . close ( )
same as build_alert_hooks .