craftbeerpi4-pione/core/api/extension.py

20 lines
476 B
Python
Raw Normal View History

2018-11-16 20:35:59 +01:00
__all__ = ["CBPiExtension"]
2018-11-01 21:25:42 +01:00
import logging
2018-11-01 21:27:37 +01:00
import os
2018-11-01 21:25:42 +01:00
2018-11-01 21:27:37 +01:00
import sys
from core.utils.utils import load_config as load
2018-11-01 21:25:42 +01:00
logger = logging.getLogger(__file__)
logging.basicConfig(level=logging.INFO)
class CBPiExtension():
def load_config(self):
path = os.path.dirname(sys.modules[self.__class__.__module__].__file__)
try:
return load("%s/config.yaml" % path)
except:
logger.warning("Faild to load config %s/config.yaml" % path)