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.57]) by gnuweeb.org (Postfix) with ESMTPSA id 89BDD7E317; Tue, 19 Jul 2022 00:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1658189882; bh=2X7rellH7v6160BfEzdhCgPsam2joogU5K6EDSV/0R8=; h=From:To:Cc:Subject:Date:From; b=uFGGt8WtTRRtGjOoQS3eUBWB8npEjoBeAxOl/h4Rlf2lo9AtvHQ03Ku3nP5S3wZ5m 5suiMqnOKHrug9uYeKnSqIvvI9sbW0ssohA2XOs7A7UlR2jo26UlcQYNScCpVi9izp EfBTT+xLhVq1gcy2QK+AW8C7BuwFdHA9sCO5uTkr641Dj1nF3yb656epfoM23pPvJ8 0Ncj+8ZDNksYzbgJqtNMLW69VzN5y5H2meGBQO3QjK7dOwBHyoZXqJC1QawrCcQ+nW 833cV+xR7ItUfkWpIBiK4KUZ/KJrxd84AMxUDqxRrHS7DLiBXfVRA1bX+LYBQVHFvc iRD3ijF3Vh8/w== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List Subject: [PATCH v2 00/18] Plan to redesign codes Date: Tue, 19 Jul 2022 07:17:26 +0700 Message-Id: <20220719001744.1950-1-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Morning sir, In this series I want to redesign codes to make it clear and clean. I've inherit the DaemonClient with the Pyrogram's Client, so with this method we can create our custom functions, such as send email message and patch message in the DaemonClient. I've fixed some bugs to and other improvements such as create a decorator. There are 18 patches in this series: - Patch 1 is to fix raw lore URL at the end of URL by regex replace - Patch 2 is to fix the lack of __send_patch_msg function parameter - Patch 3 is just add required imports and remove unused imports - Patch 4 is to add default temporary directory name - Patch 5 is to move Telegram bot session file - Patch 6 is to use traceback to get the error detail while debugging - Patch 7 is to create send email and patch msg in the DaemonClient - Patch 8 is just remove the ____send_patch_msg - Patch 9 is to move utility functions to the utils file - Patch 10 is to create fix_utf8_chars function - Patch 11 is just cleaning some codes to make it looks more practice - Patch 12 is to change some indentation space to indentation tab - Patch 13 is to remove whitespace after newline - Patch 14 is to remove unused functions because it's already moved - Patch 15 is just remove unused imports - Patch 16 is to create @handle_flood decorator to handle floodwait - Patch 17 is to remove __send_patch_msg() and displace some codes - Patch 18 is just remove unused imports I've already tested it last night and it fully works without errors, so please give it a test too, thanks. ## Changelog v1 -> v2 - Create @handle_flood to handle the Telegram floodwait. - Remove unnecessary codes to make it cleaner. - Move some utility functions into the utility file. - Remove whitespace after newline - Fix indentation issues Signed-off-by: Muhammad Rizki --- Ammar Faizi (1): daemon: Fix raw lore URL on the inline keyboard button Muhammad Rizki (17): Fix __send_patch_msg function parameter Fix import problem Add default temporary directory Move the Telegram bot session into the storage directory daemon: Use traceback.format_exc() to get the error detail Re-design send email message to Telegram Move ____send_patch_msg Move prepare for patch and clean up patch functions Create fix_utf8_chars function Recode some codes Fix indentation issue Remove whitespace Remove prepare patch and clean up patch daemon: Remove unused imports daemon: Add @handle_flood decorator and remove some functions daemon: Remove __send_patch_msg() daemon: Remove unused imports daemon/packages/__init__.py | 1 + daemon/packages/client.py | 68 +++++++++++++++ daemon/packages/decorator.py | 38 ++++++++ daemon/packages/plugins/scrape.py | 1 + daemon/run.py | 8 +- daemon/scraper/bot.py | 140 +++--------------------------- daemon/scraper/scraper.py | 4 - daemon/scraper/utils.py | 50 +++++++++-- 8 files changed, 167 insertions(+), 143 deletions(-) create mode 100644 daemon/packages/__init__.py create mode 100644 daemon/packages/client.py create mode 100644 daemon/packages/decorator.py base-commit: 339d992bdd77f19e67d0d9a30e3ac6eef1e4035a -- Muhammad Rizki