From patchwork Fri Aug 9 17:47:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Rustand X-Patchwork-Id: 1198 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id E30CE117747B0 for ; Fri, 9 Aug 2019 17:47:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,LOCAL_CHARITY=1.5, MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,SPF_HELO_NONE=0.001, T_DMARC_POLICY_NONE=0.01,T_DMARC_SIMPLE_DKIM=0.01 autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] [127.0.0.11] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 9 Aug 2019 17:47:20 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 1A6D6145C1236C; Fri, 9 Aug 2019 17:47:16 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Fri, 9 Aug 2019 17:47:16 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id F306B2BF3B; Fri, 9 Aug 2019 17:47:15 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JGfdw2am Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id DF6DF2A540 for ; Fri, 9 Aug 2019 17:47:13 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 9 Aug 2019 17:47:13 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id D6957145C1236B for ; Fri, 9 Aug 2019 17:47:08 +0000 (UTC) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 9 Aug 2019 17:47:08 +0000 (UTC) Received: by mail-lf1-x142.google.com with SMTP id s19so7424349lfb.9 for ; Fri, 09 Aug 2019 10:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bo4On2DBLKWqbFApExlfVIWg9tP6W9DbHeY2F25q4Q0=; b=JGfdw2amLdFSwynLHB7CPhPfIdcOREF+a3M3GO/aonxc7lYWisnjtX+HmWp39qT90T N8VySciBcrBEaB5orzMZfsuSDLxd4GKEm6ftmU3pT6Dk5h1EmoSIQ691y0DbVw/faufm YC7v2UFEQ92vnTRfZEoDnGTc1i0NPeRDbwRz+copEF4BlsVk7h/RIfZ9Df3+TcLfoQ7E Inqs2smr4L+7h2m9kjuTyg4LX2TsXmjyW5jiOtVruV71sB+LIqvLMUSUh0+Mc/To/1hL SxADdykfE1tRFSwFLKpNTRQB4IYGYNljs0K30WTt97F5BwAMpLCaDGbdhyrDZRPxWZyD GTcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bo4On2DBLKWqbFApExlfVIWg9tP6W9DbHeY2F25q4Q0=; b=C5lFB3PPXHK/lCC1ubnk7ZlyLA6LrtMjsCMv85kqMKQw0e/B27MJtXnvyLgpsLnFhh Vzc8PIu/o6HBnpU544FeM1jcOhtcVMntuVQckpCoOhcB6abCn7uvIXl2H5c7s4kuiB/S oB4MUoDjDe45MCdeBWvOSI6FTdC8gtOjrNflY660M19vQwgJzrjEzByctH4Asyhw8WDF JGQpX4EfLnJG8A9o/evb3PUt73kVJfeZ/dWLuVIH5AAtEsKycI8iVtSDDqRv6uMM65PD 8kg3Gqaw6Me48Zy4csb7QO1qZ66AbK8/3/HGKovVBT/NmC83gAFsq4ZMnPSNL2+XzDCm 4hzw== X-Gm-Message-State: APjAAAVHBHeZnsRx0W8h4lWJvQEZww+QXBJtO8uoVT5vC1WitecKmRo2 WzXtWDdAiRqF8czMk+fDVIlYWauHZs0= X-Google-Smtp-Source: APXvYqxas+N/LGw2Cko5hcscpGKPPUQdM1p4N4km42AddOAOSHmGlPrtQX8gKvVBy23grkcURThTzQ== X-Received: by 2002:ac2:484e:: with SMTP id 14mr13168883lfy.50.1565372827021; Fri, 09 Aug 2019 10:47:07 -0700 (PDT) Received: from localhost.localdomain (236-196-232.connect.netcom.no. [178.232.196.236]) by smtp.googlemail.com with ESMTPSA id t66sm526233lje.66.2019.08.09.10.47.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 09 Aug 2019 10:47:06 -0700 (PDT) From: Lars Rustand To: aur-dev@archlinux.org Subject: [PATCH v2] notify.py: Use a/an correctly when sending request notifications Date: Fri, 9 Aug 2019 19:47:18 +0200 Message-Id: <20190809174718.10473-1-rustand.lars@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: aur-dev@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Arch User Repository \(AUR\) Development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: aur-dev-bounces@archlinux.org Sender: "aur-dev" Will no longer send notifications about "a orphan request", but determine whether to use a/an based on the first character of the request type. Signed-off-by: Lars Rustand --- aurweb/scripts/notify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py index d975086..591b5ca 100755 --- a/aurweb/scripts/notify.py +++ b/aurweb/scripts/notify.py @@ -414,8 +414,9 @@ class RequestOpenNotification(Notification): (self._user, self._pkgbase, self._merge_into) body += '\n\n' + self._text else: - body = '%s [1] filed a %s request for %s [2]:' % \ - (self._user, self._reqtype, self._pkgbase) + an = 'an' if self._reqtype[0] in 'aeiou' else 'a' + body = '%s [1] filed %s %s request for %s [2]:' % \ + (self._user, an, self._reqtype, self._pkgbase) body += '\n\n' + self._text return body