From bb9befd475753b424aaa6df078d379edf53b83fb Mon Sep 17 00:00:00 2001 From: Sayan Chowdhury Date: Feb 01 2016 13:35:19 +0000 Subject: Move constants to a constants file --- diff --git a/bugyou_plugins/constants.py b/bugyou_plugins/constants.py new file mode 100644 index 0000000..749df5d --- /dev/null +++ b/bugyou_plugins/constants.py @@ -0,0 +1 @@ +CONFIG_FILEPATH = '/etc/bugyou/bugyou_plugins.cfg' diff --git a/bugyou_plugins/plugins/base.py b/bugyou_plugins/plugins/base.py index 69753f5..36df6a3 100644 --- a/bugyou_plugins/plugins/base.py +++ b/bugyou_plugins/plugins/base.py @@ -4,6 +4,7 @@ import multiprocessing from retask import Queue +from bugyou_plugins.constants import CONFIG_FILEPATH from bugyou_plugins.utility import get_active_services, load_config @@ -11,8 +12,7 @@ class BasePlugin(object): __metaclass__ = abc.ABCMeta def __init__(self, *args, **kwargs): - filepath = '/etc/bugyou/bugyou_plugins.cfg' - self.config = load_config(filepath) + self.config = load_config(CONFIG_FILEPATH) self.active_services = get_active_services() self.services = [] diff --git a/bugyou_plugins/services/base.py b/bugyou_plugins/services/base.py index c0d4c38..59c576b 100644 --- a/bugyou_plugins/services/base.py +++ b/bugyou_plugins/services/base.py @@ -1,10 +1,10 @@ +from bugyou_plugins.constants import CONFIG_FILEPATH from bugyou_plugins.utility import load_config class BaseService(object): def __init__(self, *args, **kwargs): - filepath = '/etc/bugyou/bugyou_services.cfg' - self.config = load_config(filepath) + self.config = load_config(CONFIG_FILEPATH) def _get_issues_titles(self): """ Returns a set of all the issues titles """