parameters: (self, rootpath)
docstring: Construct representation of the source tree by walking the file system.
docstring_summary: Construct representation of the source tree by walking the file system.
docstring_tokens: Construct representation of the source tree by walking the file system .
function: def _walk_dir(self, rootpath):
          """Construct representation of the source tree by walking the file system."""
          assert os.path.isabs(rootpath)
          assert rootpath not in self._dirs
          relpath = self._get_rel_path(rootpath)
          self._dirs[relpath] = Directory(rootpath, relpath, None)
          for dirpath, dirnames, filenames in os.walk(rootpath):
              if 'refdata' in dirnames:
                  dirnames.remove('refdata')
              currentdir = self._dirs[self._get_rel_path(dirpath)]
              # Loop through a copy so that we can modify dirnames.
              for dirname in list(dirnames):
                  fullpath = os.path.join(dirpath, dirname)
                  if fullpath == self._build_root:
                      dirnames.remove(dirname)
                      continue
                  relpath = self._get_rel_path(fullpath)
                  self._dirs[relpath] = Directory(fullpath, relpath, currentdir)
              extensions = ('.h', '.cuh', '.hpp', '.c', '.cc', '.cpp', '.cu', '.bm')
              for filename in filenames:
                  basename, extension = os.path.splitext(filename)
                  if extension in extensions:
                      fullpath = os.path.join(dirpath, filename)
                      relpath = self._get_rel_path(fullpath)
                      self._files[relpath] = File(fullpath, relpath, currentdir)
                  elif extension == '.cmakein':
                      extension = os.path.splitext(basename)[1]
                      if extension in extensions:
                          fullpath = os.path.join(dirpath, filename)
                          relpath = self._get_rel_path(fullpath)
                          sourcefile = GeneratorSourceFile(fullpath, relpath, currentdir)
                          self._files[relpath] = sourcefile
                          fullpath = os.path.join(dirpath, basename)
                          relpath = self._get_rel_path(fullpath)
                          fullpath = os.path.join(self._build_root, relpath)
                          generatedfile = GeneratedFile(fullpath, relpath, currentdir)
                          self._files[relpath] = generatedfile
                          generatedfile.set_generator_source(sourcefile)
                  elif extension in ('.l', '.y', '.pre'):
                      fullpath = os.path.join(dirpath, filename)
                      relpath = self._get_rel_path(fullpath)
                      self._files[relpath] = GeneratorSourceFile(fullpath, relpath, currentdir)
function_tokens: def _walk_dir ( self , rootpath ) : assert os . path . isabs ( rootpath ) assert rootpath not in self . _dirs relpath = self . _get_rel_path ( rootpath ) self . _dirs [ relpath ] = Directory ( rootpath , relpath , None ) for dirpath , dirnames , filenames in os . walk ( rootpath ) : if 'refdata' in dirnames : dirnames . remove ( 'refdata' ) currentdir = self . _dirs [ self . _get_rel_path ( dirpath ) ] # Loop through a copy so that we can modify dirnames. for dirname in list ( dirnames ) : fullpath = os . path . join ( dirpath , dirname ) if fullpath == self . _build_root : dirnames . remove ( dirname ) continue relpath = self . _get_rel_path ( fullpath ) self . _dirs [ relpath ] = Directory ( fullpath , relpath , currentdir ) extensions = ( '.h' , '.cuh' , '.hpp' , '.c' , '.cc' , '.cpp' , '.cu' , '.bm' ) for filename in filenames : basename , extension = os . path . splitext ( filename ) if extension in extensions : fullpath = os . path . join ( dirpath , filename ) relpath = self . _get_rel_path ( fullpath ) self . _files [ relpath ] = File ( fullpath , relpath , currentdir ) elif extension == '.cmakein' : extension = os . path . splitext ( basename ) [ 1 ] if extension in extensions : fullpath = os . path . join ( dirpath , filename ) relpath = self . _get_rel_path ( fullpath ) sourcefile = GeneratorSourceFile ( fullpath , relpath , currentdir ) self . _files [ relpath ] = sourcefile fullpath = os . path . join ( dirpath , basename ) relpath = self . _get_rel_path ( fullpath ) fullpath = os . path . join ( self . _build_root , relpath ) generatedfile = GeneratedFile ( fullpath , relpath , currentdir ) self . _files [ relpath ] = generatedfile generatedfile . set_generator_source ( sourcefile ) elif extension in ( '.l' , '.y' , '.pre' ) : fullpath = os . path . join ( dirpath , filename ) relpath = self . _get_rel_path ( fullpath ) self . _files [ relpath ] = GeneratorSourceFile ( fullpath , relpath , currentdir )