third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines.py
def _immediate_predecessors_in_fallback(self, path_to_rebaseline):
        """Returns the predecessor directories in the baseline fall-back graph.

        The platform-specific fall-back baseline directories form a tree, where
        when we search for baselines we normally fall back to parents nodes in
        the tree. The "immediate predecessors" are the children nodes of the
        given node.

        For example, if the baseline fall-back graph includes:
            "mac10.9" -> "mac10.10/"
            "mac10.10/" -> "mac/"
            "retina/" -> "mac/"
        Then, the "immediate predecessors" are:
            "mac/": ["mac10.10/", "retina/"]
            "mac10.10/": ["mac10.9/"]
            "mac10.9/", "retina/": []

        Args:
            path_to_rebaseline: The absolute path to a baseline directory.

        Returns:
            A list of directory names (not full paths) of directories that are
            "immediate predecessors" of the given baseline path.
        """
        port_names = self._tool.port_factory.all_port_names()
        immediate_predecessors = []
        for port_name in port_names:
            port = self._tool.port_factory.get(port_name)
            baseline_search_path = port.baseline_search_path()
            try:
                index = baseline_search_path.index(path_to_rebaseline)
                if index:
                    immediate_predecessors.append(
                        self._tool.filesystem.basename(
                            baseline_search_path[index - 1]))
            except ValueError:
                # baseline_search_path.index() throws a ValueError if the item isn't in the list.
                pass
        return immediate_predecessors
Returns the predecessor directories in the baseline fall-back graph.

        The platform-specific fall-back baseline directories form a tree, where
        when we search for baselines we normally fall back to parents nodes in
        the tree. The "immediate predecessors" are the children nodes of the
        given node.

        For example, if the baseline fall-back graph includes:
            "mac10.9" -> "mac10.10/"
            "mac10.10/" -> "mac/"
            "retina/" -> "mac/"
        Then, the "immediate predecessors" are:
            "mac/": ["mac10.10/", "retina/"]
            "mac10.10/": ["mac10.9/"]
            "mac10.9/", "retina/": []

        Args:
            path_to_rebaseline: The absolute path to a baseline directory.

        Returns:
            A list of directory names (not full paths) of directories that are
            "immediate predecessors" of the given baseline path.
        
Returns the predecessor directories in the baseline fall-back graph.
The platform-specific fall-back baseline directories form a tree, where
when we search for baselines we normally fall back to parents nodes in
the tree. The "immediate predecessors" are the children nodes of the
given node.


Returns the predecessor directories in the baseline fall - back graph . The platform - specific fall - back baseline directories form a tree where when we search for baselines we normally fall back to parents nodes in the tree . The " immediate predecessors " are the children nodes of the given node .
def _immediate_predecessors_in_fallback(self, path_to_rebaseline):
        port_names = self._tool.port_factory.all_port_names()
        immediate_predecessors = []
        for port_name in port_names:
            port = self._tool.port_factory.get(port_name)
            baseline_search_path = port.baseline_search_path()
            try:
                index = baseline_search_path.index(path_to_rebaseline)
                if index:
                    immediate_predecessors.append(
                        self._tool.filesystem.basename(
                            baseline_search_path[index - 1]))
            except ValueError:
                pass
        return immediate_predecessors
def _immediate_predecessors_in_fallback ( self , path_to_rebaseline ) : port_names = self . _tool . port_factory . all_port_names ( ) immediate_predecessors = [ ] for port_name in port_names : port = self . _tool . port_factory . get ( port_name ) baseline_search_path = port . baseline_search_path ( ) try : index = baseline_search_path . index ( path_to_rebaseline ) if index : immediate_predecessors . append ( self . _tool . filesystem . basename ( baseline_search_path [ index - 1 ] ) ) except ValueError : pass return immediate_predecessors
Returns the predecessor directories in the baseline fall-back graph.
Returns the predecessor directories in the baseline fall - back graph .
"""Returns the predecessor directories in the baseline fall-back graph.

        The platform-specific fall-back baseline directories form a tree, where
        when we search for baselines we normally fall back to parents nodes in
        the tree. The "immediate predecessors" are the children nodes of the
        given node.

        For example, if the baseline fall-back graph includes:
            "mac10.9" -> "mac10.10/"
            "mac10.10/" -> "mac/"
            "retina/" -> "mac/"
        Then, the "immediate predecessors" are:
            "mac/": ["mac10.10/", "retina/"]
            "mac10.10/": ["mac10.9/"]
            "mac10.9/", "retina/": []

        Args:
            path_to_rebaseline: The absolute path to a baseline directory.

        Returns:
            A list of directory names (not full paths) of directories that are
            "immediate predecessors" of the given baseline path.
        """ # baseline_search_path.index() throws a ValueError if the item isn't in the list.
A list of directory names (not full paths) of directories that are
"immediate predecessors" of the given baseline path.
A list of directory names ( not full paths ) of directories that are " immediate predecessors " of the given baseline path .
self
path_to_rebaseline
The absolute path to a baseline directory.
The absolute path to a baseline directory .