parameters: (self, path, filesystem_absolute=False, srcdir=None)
docstring: Normalizes paths.
  
          If the path is absolute, behavior is governed by filesystem_absolute.
          If filesystem_absolute is True, the path is interpreted as absolute on
          the actual filesystem. If it is false, the path is treated as absolute
          within the current topsrcdir.
  
          If the path is not absolute, it will be treated as relative to the
          currently executing file. If there is no currently executing file, it
          will be treated as relative to topsrcdir.
docstring_summary: Normalizes paths.
docstring_tokens: Normalizes paths .
function: def normalize_path(self, path, filesystem_absolute=False, srcdir=None):
          """Normalizes paths.
  
          If the path is absolute, behavior is governed by filesystem_absolute.
          If filesystem_absolute is True, the path is interpreted as absolute on
          the actual filesystem. If it is false, the path is treated as absolute
          within the current topsrcdir.
  
          If the path is not absolute, it will be treated as relative to the
          currently executing file. If there is no currently executing file, it
          will be treated as relative to topsrcdir.
          """
          if os.path.isabs(path):
              if filesystem_absolute:
                  return path
              roots = [self._context.config.topsrcdir]
              if self._context.config.external_source_dir:
                  roots.append(self._context.config.external_source_dir)
              for root in roots:
                  # mozpath.join would ignore the self._context.config.topsrcdir
                  # argument if we passed in the absolute path, so omit the
                  # leading /
                  p = mozpath.normpath(mozpath.join(root, path[1:]))
                  if os.path.exists(p):
                      return p
              # mozpath.join would ignore the self.condig.topsrcdir argument if
              # we passed in the absolute path, so omit the leading /
              return mozpath.normpath(
                  mozpath.join(self._context.config.topsrcdir, path[1:]))
          elif srcdir:
              return mozpath.normpath(mozpath.join(srcdir, path))
          elif len(self._execution_stack):
              return mozpath.normpath(mozpath.join(
                  mozpath.dirname(self._execution_stack[-1]), path))
          else:
              return mozpath.normpath(
                  mozpath.join(self._context.config.topsrcdir, path))
function_tokens: def normalize_path ( self , path , filesystem_absolute = False , srcdir = None ) : if os . path . isabs ( path ) : if filesystem_absolute : return path roots = [ self . _context . config . topsrcdir ] if self . _context . config . external_source_dir : roots . append ( self . _context . config . external_source_dir ) for root in roots : # mozpath.join would ignore the self._context.config.topsrcdir # argument if we passed in the absolute path, so omit the # leading / p = mozpath . normpath ( mozpath . join ( root , path [ 1 : ] ) ) if os . path . exists ( p ) : return p # mozpath.join would ignore the self.condig.topsrcdir argument if # we passed in the absolute path, so omit the leading / return mozpath . normpath ( mozpath . join ( self . _context . config . topsrcdir , path [ 1 : ] ) ) elif srcdir : return mozpath . normpath ( mozpath . join ( srcdir , path ) ) elif len ( self . _execution_stack ) : return mozpath . normpath ( mozpath . join ( mozpath . dirname ( self . _execution_stack [ - 1 ] ) , path ) ) else : return mozpath . normpath ( mozpath . join ( self . _context . config . topsrcdir , path ) )