From ffc3fe218d33e0cc4587082cd152039d4651851f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 28 Aug 2024 00:13:46 +0200 Subject: [PATCH] [config] Added `config.get_config_dir` method. --- platypush/plugins/config/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platypush/plugins/config/__init__.py b/platypush/plugins/config/__init__.py index 2959863f98..0624e6d0b5 100644 --- a/platypush/plugins/config/__init__.py +++ b/platypush/plugins/config/__init__.py @@ -1,4 +1,5 @@ import json +import os from platypush import Config from platypush.message import Message @@ -66,5 +67,12 @@ class ConfigPlugin(Plugin): """ return Config._instance.config_file + @action + def get_config_dir(self) -> str: + """ + :return: The path to the configuration directory. + """ + return os.path.dirname(Config._instance.config_file) + # vim:sw=4:ts=4:et: