[config] Added config.get_config_dir method.

This commit is contained in:
Fabio Manganiello 2024-08-28 00:13:46 +02:00
parent dea72fbfdb
commit ef524fa388

View file

@ -1,4 +1,5 @@
import json import json
import os
from platypush import Config from platypush import Config
from platypush.message import Message from platypush.message import Message
@ -66,5 +67,12 @@ class ConfigPlugin(Plugin):
""" """
return Config._instance.config_file 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: # vim:sw=4:ts=4:et: