def requires_files(files):
 def check_files_precondition():
  for file in files:
   if (not os.path.exists(extras.get_extras_path(file))):
    return (False, ('required file %s not found' % file))
  return (True, '')
 def wrapper(cls):
  cls.check_precondition = _build_precondition_join_fn(cls, check_files_precondition)
  return cls
 return wrapper

def requires_files ( files ) : def check_files_precondition ( ) : for file in files : if ( not os . path . exists ( extras . get_extras_path ( file ) ) ) : return ( False , ( 'required file %s not found' % file ) ) return ( True , '' ) def wrapper ( cls ) : cls . check_precondition = _build_precondition_join_fn ( cls , check_files_precondition ) return cls return wrapper
decorator for creating a handler that requies files be present in the extras dir in order to run files: required files to be present for the handler to be available .