def register_scm_provider(scm_name: str):
    """Return a decorator for registering a SCM provider named `scm_name`."""

    def register_decorator(scm_class: SourceControl):
        """Decorator for registering SCM provider."""
        if scm_name in ScmManager.providers:
            raise KeyError('{} already registered!'.format(scm_name))
        ScmManager.providers[scm_name] = scm_class
        SourceControl.register(scm_class)
        logger.debug('Registered {0} SCM from {1.__module__}.{1.__name__}',
                     scm_name, scm_class)
        return scm_class
    return register_decorator
def register_scm_provider ( scm_name : str ) : def register_decorator ( scm_class : SourceControl ) : if scm_name in ScmManager . providers : raise KeyError ( '{} already registered!' . format ( scm_name ) ) ScmManager . providers [ scm_name ] = scm_class SourceControl . register ( scm_class ) logger . debug ( 'Registered {0} SCM from {1.__module__}.{1.__name__}' , scm_name , scm_class ) return scm_class return register_decorator
Return a decorator for registering a SCM provider named `scm_name`.