From 482c57ee0781c1dffcfc8d95420fb265a355de2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Tue, 28 Jun 2016 15:08:13 +0200 Subject: [PATCH] Add a config option for the messaging system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Petr Ĺ abata --- rida.conf | 1 + rida/config.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/rida.conf b/rida.conf index 609c3057..65ccee3c 100644 --- a/rida.conf +++ b/rida.conf @@ -1,5 +1,6 @@ [DEFAULT] system = koji +messaging = fedmsg koji = http://koji.stg.fedoraproject.org/kojihub db = sqlite:///rida.db pdc = http://pdc.stg.fedoraproject.org/ diff --git a/rida/config.py b/rida/config.py index 936c8520..20226344 100644 --- a/rida/config.py +++ b/rida/config.py @@ -48,6 +48,7 @@ def from_file(filename=None): conf = Config() conf.db = default.get("db") conf.system = default.get("system") + conf.messaging = default.get("messaging") conf.pdc = default.get("pdc") conf.koji = default.get("koji") conf.scmurls = json.loads(default.get("scmurls")) @@ -59,6 +60,7 @@ class Config(object): def __init__(self): """Initialize the Config object.""" self._system = "" + self._messaging = "" self._db = "" self._pdc = "" self._koji = "" @@ -75,6 +77,18 @@ class Config(object): raise ValueError("Unsupported buildsystem.") self._system = s + @property + def messaging(self): + """The messaging system to use.""" + return self._messaging + + @messaging.setter + def messaging(self, s): + s = str(s) + if s not in ("fedmsg"): + raise ValueError("Unsupported messaging system.") + self._messaging = s + @property def db(self): """RDB URL."""