From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.217]) by gnuweeb.org (Postfix) with ESMTPSA id C20A97E257; Mon, 3 Oct 2022 23:53:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664841203; bh=VftwyZOLmtVgtMElu+5eFY7tc5rWCFT4z3ZwHiAl3v8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHDOlh7uB9aeK6iMIFa1Sd2/5K4uIRrmTOfenIo+LERl/74FfjogJ5i5yl0fHnAQ0 2dFPfQ8+IzPi9ygEmPkqvwHrtW0vuoCv3f7FTNHt3i2vCrdCnE+abIwSI1/WVOhiBJ XEGVGsG+xlABW7cQ9e9XHb4FxHHJQ28K6wfBFSz3Z+VanQ7vJ7agkiCniLK9ES4oUN Qky0zoWUpG2HAB7FV4ZhKxAMHIeaWoS0iFIPJ9C4QsVZJNyCEckAtnTdo6Fw0mKXEy Wsa4rtPoNpllSRrFGDExII8ltypv5Dqca41vYENjAZJQ3YBEHKGWscUNSRMxU8Hdam FJcf4rLqLEuLQ== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 14/28] telegram: Rename some utility functions Date: Tue, 4 Oct 2022 06:52:15 +0700 Message-Id: <20221003235230.1824-15-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221003235230.1824-1-kiizuha@gnuweeb.org> References: <20221003235230.1824-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Rename prepare_send_patch() to prepare_patch and clean_up_after_send_patch() to remove_patch() to make them easier to read and practice. Signed-off-by: Muhammad Rizki --- daemon/atom/utils.py | 4 ++-- daemon/telegram/packages/client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/atom/utils.py b/daemon/atom/utils.py index 2aa4bce..870ee70 100644 --- a/daemon/atom/utils.py +++ b/daemon/atom/utils.py @@ -212,7 +212,7 @@ def create_template(thread: Message, platform: str, to=None, cc=None): return ret, files, is_patch -def prepare_send_patch(mail, text, url, platform: str): +def prepare_patch(mail, text, url, platform: str): tmp = gen_temp(url, platform) fnm = str(mail.get("subject")) sch = re.search(PATCH_PATTERN, fnm, re.IGNORECASE) @@ -238,7 +238,7 @@ def prepare_send_patch(mail, text, url, platform: str): return tmp, file, caption, url -def clean_up_after_send_patch(tmp): +def remove_patch(tmp): shutil.rmtree(tmp) diff --git a/daemon/telegram/packages/client.py b/daemon/telegram/packages/client.py index 17061ec..686e5ef 100644 --- a/daemon/telegram/packages/client.py +++ b/daemon/telegram/packages/client.py @@ -56,7 +56,7 @@ class DaemonClient(Client): parse_mode: ParseMode = ParseMode.HTML ) -> Message: print("[send_patch_email]") - tmp, doc, caption, url = utils.prepare_send_patch( + tmp, doc, caption, url = utils.prepare_patch( mail, text, url, "telegram" ) m = await self.send_document( @@ -73,5 +73,5 @@ class DaemonClient(Client): ]) ) - utils.clean_up_after_send_patch(tmp) + utils.remove_patch(tmp) return m -- Muhammad Rizki