Parse a list of map strings (mappings).

        Accepts two distinct formats:
        1. If there are exactly two entries then these may be the source
        base URI and the destination base path. Neither may contain an
        equals (=) sign.
        2. For any number of mapping stings interpret each as a mapping
        URI=path. These are in the order they will be tried.

        And if use_default_path is True then a third:
        3. If there is exactly one entry and it does not contain an
        equals (=) sign then a safe local path is created based on the
        source base URI. In the case that the source base URI is a local
        path already then an indentity mapping is used.

def parse(self, mappings, use_default_path=False):
        """Parse a list of map strings (mappings).

        Accepts two distinct formats:
        1. If there are exactly two entries then these may be the source
        base URI and the destination base path. Neither may contain an
        equals (=) sign.
        2. For any number of mapping stings interpret each as a mapping
        URI=path. These are in the order they will be tried.

        And if use_default_path is True then a third:
        3. If there is exactly one entry and it does not contain an
        equals (=) sign then a safe local path is created based on the
        source base URI. In the case that the source base URI is a local
        path already then an indentity mapping is used.
        """
        if (use_default_path and
                len(mappings) == 1 and
                re.search(r"=", mappings[0]) is None):
            path = self.path_from_uri(mappings[0])
            self.logger.warning("Using URI mapping: %s -> %s" %
                                (mappings[0], path))
            self.mappings.append(Map(mappings[0], path))
        elif (len(mappings) == 2 and
              re.search(r"=", mappings[0]) is None and
              re.search(r"=", mappings[1]) is None):
            self.mappings.append(Map(mappings[0], mappings[1]))
        else:
            for mapping in mappings:
                l = mapping.split('=')
                if (len(l) != 2):
                    raise MapperError(
                        "Bad mapping argument (%s), got %s" %
                        (mapping, str(l)))
                (src_uri, dst_path) = l
                # Check for dupes
                for map in self.mappings:
                    if (src_uri == map.src_uri):
                        raise MapperError(
                            "Attempt to set duplicate mapping for "
                            "source URI %s (with destination path %s)" %
                            (src_uri, dst_path))
                    if (dst_path == map.dst_path):
                        raise MapperError(
                            "Attempt to set duplicate mapping for "
                            "destination path %s (with source URI %s)" %
                            (dst_path, src_uri))
                self.mappings.append(Map(src_uri, dst_path))