]> git.ipfire.org Git - people/ms/westferry.git/commitdiff
backend: Add initialize() to backend objects
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 6 Dec 2021 17:11:40 +0000 (17:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 6 Dec 2021 17:11:40 +0000 (17:11 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/westferry/backend/base.py

index 3ebf2d939727fd9318cc95cb170923b5aab020a3..57dea7a0372215a4c0b2c6b135668b4768c66916 100644 (file)
 ###############################################################################
 
 class BaseBackend(object):
-       def __init__(self, backend):
+       def __init__(self, backend, *args, **kwargs):
                self.backend = backend
+
+               # Call initialize
+               self.initialize(*args, **kwargs)
+
+       def initialize(self):
+               """
+                       This function should be overlayed by any inheriting classes
+                       and perform any initialization tasks.
+               """
+               pass