changeset 8649:2589ee18c796

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.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Wed, 30 Sep 2020 16:57:05 +0200
parents af7b367f6b5a
children 833b93e83349
files kallithea/config/rcextensions/__init__.py
diffstat 1 files changed, 7 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- 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