platypush/platypush/plugins/__init__.py

21 lines
521 B
Python
Raw Normal View History

import sys
2017-12-11 03:53:26 +01:00
import logging
2017-12-18 01:10:51 +01:00
from platypush.config import Config
from platypush.message.response import Response
2017-10-31 09:20:35 +01:00
class Plugin(object):
2017-12-18 01:10:51 +01:00
""" Base plugin class """
2017-11-03 15:06:29 +01:00
2017-12-18 01:10:51 +01:00
def __init__(self, **kwargs):
logging.basicConfig(stream=sys.stdout, level=Config.get('logging')
if 'logging' not in kwargs
else getattr(logging, kwargs['logging']))
def run(self, method, *args, **kwargs):
return getattr(self, method)(*args, **kwargs)
2017-10-31 09:20:35 +01:00
# vim:sw=4:ts=4:et: