'Get (or replace) the current plugin registry
@param plugins: the new registry'

@classmethod
def _registry(cls, plugins=None):

    session_s3 = current.session.s3
    if plugins:
        registry = session_s3.plugins = plugins
    else:
        registry = session_s3.plugins
        if (registry is None):
            registry = session_s3.plugins = {}
            cls.detect()
    return registry
