# HG changeset patch # User Thomas De Schampheleire # Date 1601477825 -7200 # Node ID 2589ee18c7962517690d8c77e22a79bf9e77839d # Parent af7b367f6b5a2491d9fed37c79530e66e3e81878 rcextensions: rename default hook stubs There seems to be no reason that in indirection is needed between the actual hook name and the implementation. Moreover, the implementation names were unnecessary complex. diff -r af7b367f6b5a -r 2589ee18c796 kallithea/config/rcextensions/__init__.py --- a/kallithea/config/rcextensions/__init__.py Mon Jun 15 12:37:55 2020 +0200 +++ b/kallithea/config/rcextensions/__init__.py Wed Sep 30 16:57:05 2020 +0200 @@ -30,7 +30,7 @@ # POST CREATE REPOSITORY HOOK #============================================================================== # this function will be executed after each repository is created -def _crrepohook(*args, **kwargs): +def CREATE_REPO_HOOK(*args, **kwargs): """ Post create repository HOOK kwargs available: @@ -50,14 +50,11 @@ """ -CREATE_REPO_HOOK = _crrepohook - - #============================================================================== # PRE CREATE USER HOOK #============================================================================== # this function will be executed before each user is created -def _pre_cruserhook(*args, **kwargs): +def PRE_CREATE_USER_HOOK(*args, **kwargs): """ Pre create user HOOK, it returns a tuple of bool, reason. If bool is False the user creation will be stopped and reason @@ -76,13 +73,11 @@ return True, reason -PRE_CREATE_USER_HOOK = _pre_cruserhook - #============================================================================== # POST CREATE USER HOOK #============================================================================== # this function will be executed after each user is created -def _cruserhook(*args, **kwargs): +def CREATE_USER_HOOK(*args, **kwargs): """ Post create user HOOK kwargs available: @@ -108,14 +103,11 @@ """ -CREATE_USER_HOOK = _cruserhook - - #============================================================================== # POST DELETE REPOSITORY HOOK #============================================================================== # this function will be executed after each repository deletion -def _dlrepohook(*args, **kwargs): +def DELETE_REPO_HOOK(*args, **kwargs): """ Post delete repository HOOK kwargs available: @@ -136,14 +128,11 @@ """ -DELETE_REPO_HOOK = _dlrepohook - - #============================================================================== # POST DELETE USER HOOK #============================================================================== # this function will be executed after each user is deleted -def _dluserhook(*args, **kwargs): +def DELETE_USER_HOOK(*args, **kwargs): """ Post delete user HOOK kwargs available: @@ -169,16 +158,13 @@ """ -DELETE_USER_HOOK = _dluserhook - - #============================================================================== # POST PUSH HOOK #============================================================================== # this function will be executed after each push it's executed after the # build-in hook that Kallithea uses for logging pushes -def _pushhook(*args, **kwargs): +def PUSH_HOOK(*args, **kwargs): """ Post push hook kwargs available: @@ -193,16 +179,13 @@ """ -PUSH_HOOK = _pushhook - - #============================================================================== # POST PULL HOOK #============================================================================== # this function will be executed after each push it's executed after the # build-in hook that Kallithea uses for logging pulls -def _pullhook(*args, **kwargs): +def PULL_HOOK(*args, **kwargs): """ Post pull hook kwargs available:: @@ -214,6 +197,3 @@ :param action: pull :param repository: repository name """ - - -PULL_HOOK = _pullhook