Added get_src_root utility function.

This commit is contained in:
Fabio Manganiello 2023-08-23 02:53:31 +02:00
parent 1ef0d804db
commit b10ccdb313
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -646,4 +646,13 @@ def get_remaining_timeout(
return cls(max(0, timeout - (time.time() - start))) 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: # vim:sw=4:ts=4:et: