'register(app) -> True/False'

def register(self, app):

    assert self._initialized, 'Registry    not    yet    initialized'
    try:
        existing = self._apps[app.name]
        version_diff = common.cmp_version(existing.version, app.version)
        if (version_diff == 0):
            LOG.warn(('%s    is    already    registered' % (app,)))
            return False
        elif (version_diff < 0):
            LOG.info(('Upgrading    %s    from    version    %s' % (app, existing.version)))
        elif (version_diff > 0):
            LOG.error(('A    newer    version    (%s)    of    %s    is    already    installed' % (existing.version, app)))
            return False
    except KeyError:
        pass
    LOG.info(('Updating    registry    with    %s' % (app,)))
    self._apps[app.name] = app
    return True
