From 7521a39e70440a380e4e1ed9e308fbf63db159ac Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Nov 23 2015 06:29:40 +0000 Subject: Move the utility file to a generic location --- diff --git a/bugyou_plugins/plugins/base.py b/bugyou_plugins/plugins/base.py index b6c647f..4966315 100644 --- a/bugyou_plugins/plugins/base.py +++ b/bugyou_plugins/plugins/base.py @@ -30,6 +30,10 @@ class BasePlugin(object): process = multiprocessing.Process(target=self.consume) process.start() + def load_services(self): + """ Load the services for the plugin """ + raise NotImplementedError() + @abc.abstractmethod def process(self): """ Consumes the messages from retask """ diff --git a/bugyou_plugins/services/utility.py b/bugyou_plugins/services/utility.py deleted file mode 100644 index e0c04d5..0000000 --- a/bugyou_plugins/services/utility.py +++ /dev/null @@ -1,9 +0,0 @@ -import ConfigParser - -def load_config(): - filepath = '/etc/bugyou/bugyou.cfg' - if not os.path.exists(name): - raise Exception('Please add a proper cofig file under /etc/bugyou') - - config = ConfigParser.RawConfigParser() - return config.read(name) diff --git a/bugyou_plugins/utility.py b/bugyou_plugins/utility.py new file mode 100644 index 0000000..ea7a15b --- /dev/null +++ b/bugyou_plugins/utility.py @@ -0,0 +1,9 @@ +import ConfigParser + +def load_config(): + filepath = '/etc/bugyou/bugyou_services.cfg' + if not os.path.exists(name): + raise Exception('Please add a proper cofig file under /etc/bugyou') + + config = ConfigParser.RawConfigParser() + return config.read(name)