From nobody Mon Sep 16 19:47:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542766212261699.1409911397661; Tue, 20 Nov 2018 18:10:12 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D2A8308FB8A; Wed, 21 Nov 2018 02:10:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E1125D9CB; Wed, 21 Nov 2018 02:10:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 644A43F7D0; Wed, 21 Nov 2018 02:10:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAL2A9wl006170 for ; Tue, 20 Nov 2018 21:10:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9773266082; Wed, 21 Nov 2018 02:10:09 +0000 (UTC) Received: from magic.redhat.com (ovpn-12-78.pek2.redhat.com [10.72.12.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5883B608C4; Wed, 21 Nov 2018 02:10:06 +0000 (UTC) From: Fam Zheng To: patchew-devel@redhat.com Date: Wed, 21 Nov 2018 10:08:42 +0800 Message-Id: <20181121020846.7875-13-famz@redhat.com> In-Reply-To: <20181121020846.7875-1-famz@redhat.com> References: <20181121020846.7875-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: patchew-devel@redhat.com Cc: ymankad@redhat.com, armbru@redhat.com Subject: [Patchew-devel] [PATCH 12/16] maintainer: Add MessageQueued and MessageDropping events X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 21 Nov 2018 02:10:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" These events are not used internally but is an interesting point where users can receive notifications when the watched queue is updated. Signed-off-by: Fam Zheng --- mods/maintainer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/maintainer.py b/mods/maintainer.py index 665b074..6b09057 100644 --- a/mods/maintainer.py +++ b/mods/maintainer.py @@ -16,7 +16,7 @@ from mod import PatchewModule from api.models import Message, Queue, WatchedQuery from django.shortcuts import render from api.search import SearchEngine -from event import register_handler +from event import declare_event, register_handler, emit_event =20 class MaintainerModule(PatchewModule): """ Project maintainer related tasks """ @@ -25,6 +25,12 @@ class MaintainerModule(PatchewModule): =20 def __init__(self): register_handler("ResultUpdate", self.on_result_update) + declare_event("MessageQueued", + message=3D"Message added", + queue=3D"The updated queue") + declare_event("MessageDropping", + message=3D"Message to be dropped", + queue=3D"Message is about to be dropping from a queu= e") =20 def _add_to_queue(self, user, m, queue): for x in [m] + list(m.get_patches()): --=20 2.17.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel