From b10ccdb31326590a292afc6c1080d2d0303f0776 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 23 Aug 2023 02:53:31 +0200 Subject: [PATCH] Added get_src_root utility function. --- platypush/utils/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platypush/utils/__init__.py b/platypush/utils/__init__.py index 7f16cce826..3ec6934e09 100644 --- a/platypush/utils/__init__.py +++ b/platypush/utils/__init__.py @@ -646,4 +646,13 @@ def get_remaining_timeout( return cls(max(0, timeout - (time.time() - start))) +def get_src_root() -> str: + """ + :return: The root source folder of the application. + """ + import platypush + + return os.path.dirname(inspect.getfile(platypush)) + + # vim:sw=4:ts=4:et: