parameters: (self, dirs, name=None, mandatory=True, once=True, encoding=None)
docstring: Runs user-provided functions from the supplied list of directories.
  		The directories can be either absolute, or relative to the directory
  		of the wscript file
  
  		The methods :py:meth:`waflib.Context.Context.pre_recurse` and
  		:py:meth:`waflib.Context.Context.post_recurse` are called immediately before
  		and after a script has been executed.
  
  		:param dirs: List of directories to visit
  		:type dirs: list of string or space-separated string
  		:param name: Name of function to invoke from the wscript
  		:type  name: string
  		:param mandatory: whether sub wscript files are required to exist
  		:type  mandatory: bool
  		:param once: read the script file once for a particular context
  		:type once: bool
docstring_summary: Runs user-provided functions from the supplied list of directories.
  		The directories can be either absolute, or relative to the directory
  		of the wscript file
docstring_tokens: Runs user - provided functions from the supplied list of directories . The directories can be either absolute or relative to the directory of the wscript file
function: def recurse(self, dirs, name=None, mandatory=True, once=True, encoding=None):
  		"""
  		Runs user-provided functions from the supplied list of directories.
  		The directories can be either absolute, or relative to the directory
  		of the wscript file
  
  		The methods :py:meth:`waflib.Context.Context.pre_recurse` and
  		:py:meth:`waflib.Context.Context.post_recurse` are called immediately before
  		and after a script has been executed.
  
  		:param dirs: List of directories to visit
  		:type dirs: list of string or space-separated string
  		:param name: Name of function to invoke from the wscript
  		:type  name: string
  		:param mandatory: whether sub wscript files are required to exist
  		:type  mandatory: bool
  		:param once: read the script file once for a particular context
  		:type once: bool
  		"""
  		try:
  			cache = self.recurse_cache
  		except AttributeError:
  			cache = self.recurse_cache = {}
  
  		for d in Utils.to_list(dirs):
  
  			if not os.path.isabs(d):
  				# absolute paths only
  				d = os.path.join(self.path.abspath(), d)
  
  			WSCRIPT     = os.path.join(d, WSCRIPT_FILE)
  			WSCRIPT_FUN = WSCRIPT + '_' + (name or self.fun)
  
  			node = self.root.find_node(WSCRIPT_FUN)
  			if node and (not once or node not in cache):
  				cache[node] = True
  				self.pre_recurse(node)
  				try:
  					function_code = node.read('r', encoding)
  					exec(compile(function_code, node.abspath(), 'exec'), self.exec_dict)
  				finally:
  					self.post_recurse(node)
  			elif not node:
  				node = self.root.find_node(WSCRIPT)
  				tup = (node, name or self.fun)
  				if node and (not once or tup not in cache):
  					cache[tup] = True
  					self.pre_recurse(node)
  					try:
  						wscript_module = load_module(node.abspath(), encoding=encoding)
  						user_function = getattr(wscript_module, (name or self.fun), None)
  						if not user_function:
  							if not mandatory:
  								continue
  							raise Errors.WafError('No function %r defined in %s' % (name or self.fun, node.abspath()))
  						user_function(self)
  					finally:
  						self.post_recurse(node)
  				elif not node:
  					if not mandatory:
  						continue
  					try:
  						os.listdir(d)
  					except OSError:
  						raise Errors.WafError('Cannot read the folder %r' % d)
  					raise Errors.WafError('No wscript file in directory %s' % d)
function_tokens: def recurse ( self , dirs , name = None , mandatory = True , once = True , encoding = None ) : try : cache = self . recurse_cache except AttributeError : cache = self . recurse_cache = { } for d in Utils . to_list ( dirs ) : if not os . path . isabs ( d ) : # absolute paths only d = os . path . join ( self . path . abspath ( ) , d ) WSCRIPT = os . path . join ( d , WSCRIPT_FILE ) WSCRIPT_FUN = WSCRIPT + '_' + ( name or self . fun ) node = self . root . find_node ( WSCRIPT_FUN ) if node and ( not once or node not in cache ) : cache [ node ] = True self . pre_recurse ( node ) try : function_code = node . read ( 'r' , encoding ) exec ( compile ( function_code , node . abspath ( ) , 'exec' ) , self . exec_dict ) finally : self . post_recurse ( node ) elif not node : node = self . root . find_node ( WSCRIPT ) tup = ( node , name or self . fun ) if node and ( not once or tup not in cache ) : cache [ tup ] = True self . pre_recurse ( node ) try : wscript_module = load_module ( node . abspath ( ) , encoding = encoding ) user_function = getattr ( wscript_module , ( name or self . fun ) , None ) if not user_function : if not mandatory : continue raise Errors . WafError ( 'No function %r defined in %s' % ( name or self . fun , node . abspath ( ) ) ) user_function ( self ) finally : self . post_recurse ( node ) elif not node : if not mandatory : continue try : os . listdir ( d ) except OSError : raise Errors . WafError ( 'Cannot read the folder %r' % d ) raise Errors . WafError ( 'No wscript file in directory %s' % d )