'Applies settings from the indicated backend to the AppInfoExternal.
Backend entries may contain directives that modify other parts of the
app.yaml, such as the \'start\' directive, which adds a handler for the start
request.  This method performs those modifications.
Args:
backend_name: The name of a backend defined in \'backends\'.
Raises:
BackendNotFound: if the indicated backend was not listed in \'backends\'.
DuplicateBackend: if backend is found more than once in \'backends\'.'

def ApplyBackendSettings(self, backend_name):

    if (backend_name is None):
        return
    if (self.backends is None):
        raise appinfo_errors.BackendNotFound
    self.version = backend_name
    match = None
    for backend in self.backends:
        if (backend.name != backend_name):
            continue
        if match:
            raise appinfo_errors.DuplicateBackend
        else:
            match = backend
    if (match is None):
        raise appinfo_errors.BackendNotFound
    if (match.start is None):
        return
    start_handler = URLMap(url=_START_PATH, script=match.start)
    self.handlers.insert(0, start_handler)
