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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by gnuweeb.org (Postfix) with ESMTPS id B24207E24F for ; Mon, 18 Jul 2022 11:20:36 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=mm7i/5Xu; dkim-atps=neutral Received: by mail-pl1-f170.google.com with SMTP id j12so8714444plj.8 for ; Mon, 18 Jul 2022 04:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fxXMYWkCDQAmz0mAaVSSYgtcSWNLeE9qbuCi4cTfp18=; b=mm7i/5XuTdrOuqD81IZcCk8qE4JYlXPmqxnPrk8a6S2kA5Lci2bMu8toXHJZ7Oa1mO uOCisyRBJN+XQ/ccvRzLBxWj85/FSIsCsmkB/QUJw4EmjsjrfhB9VJKSL5EU5N/0Go+d hqY8Gxl/NwKaM9pha8HJc/AiorztbcjFSY9fHMfpsGRDQ4aWFQdoYOZbieFlExLr7OBv g/37ZeZ24Cs+OuAOcL8LfC8bFrbpqGVCs8ylQA10Eyqj++Ww/rj6qKyRq4H9+4rS38/U fOaSaZxo/IYNIvcCSU4sg3hFgjRxoPMaDqUJ3sVH7gVSJjg2bO2X8d/VQlPXSEvMl5uN HMdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fxXMYWkCDQAmz0mAaVSSYgtcSWNLeE9qbuCi4cTfp18=; b=D/zAHSRSj9QzBsi3xK7nGTKqiRHTqM5dRrQaM/Kbg41xqo2GLxV978ZWTE+6Ptsu/j 0engTwbQK2Q6WiHR4qPAKQfn2hdLzngy92mgMuh35YY9sO04c4UX0pbOLgSGrX0gc1I1 +yPROX2g8cpPAUTIoBVMy6wSaZ9y1rU9MbimMN2Tx7JKZUxSP38UxUarnN4itQb7bQG1 3KXHnfd0aR+cbjUZJR9WiJutXvvICKHnTgJGsIriKJmRfb0ZMf0H2N414jYgnSrKyJwI HK46ftObtDr03ougulS+8llAnAC6nG7DO3qlhADsg0mONuDo7hclTxRrjyMaJI2FDGEh xtkA== X-Gm-Message-State: AJIora/l1bIYvYcnvsQAgQ/M1MCR754dqOSIXct3dF0dblRS2sGa7EAx OP/nuqOVWeC53lhIoHLsySg= X-Google-Smtp-Source: AGRyM1tYeidh/9R/+WTZuSqa0pWnJRDcZ6lalj2pH2kPQnhc9a4lf15dUvjH2EHHBmsyE4Q1pJQqCA== X-Received: by 2002:a17:902:a513:b0:16c:e25e:16b with SMTP id s19-20020a170902a51300b0016ce25e016bmr9875654plq.86.1658143236023; Mon, 18 Jul 2022 04:20:36 -0700 (PDT) Received: from localhost.localdomain ([101.128.125.134]) by smtp.gmail.com with ESMTPSA id z14-20020aa7948e000000b0052ad6d627a6sm8991072pfk.166.2022.07.18.04.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 04:20:35 -0700 (PDT) From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List Subject: [PATCH v1 00/11] Plan to redesign code Date: Mon, 18 Jul 2022 18:19:56 +0700 Message-Id: <20220718112007.792-1-riskimuhammmad1@gmail.com> X-Mailer: git-send-email 2.34.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Hi 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. There 10 patches in this series: - Patch 1 is to fix the lack of __send_patch_msg function parameter - Patch 2 is just add required imports and remove unused imports - Patch 3 is to add default temporary directory name - Patch 4 is to move Telegram bot session file - Patch 5 is to add traceback to get the error detail while debugging - Patch 6 is to create send email and patch msg in the DaemonClient - Patch 7 is just remove the ____send_patch_msg - Patch 8 is to move utility functions to the utils file - Patch 9 is to create fix_utf8_chars function - Patch 10 is just cleaning some codes to make it looks more practice Please give it a test, thanks. Signed-off-by: Muhammad Rizki --- Ammar Faizi (1): daemon: Fix raw lore URL on the inline keyboard button Muhammad Rizki (10): Fix __send_patch_msg function parameter Fix import problem Add default temporary directory Move the Telegram bot session into the storage directory Add traceback 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 daemon/packages/__init__.py | 1 + daemon/packages/client.py | 59 ++++++++++++++++++++++++++++++ daemon/packages/plugins/scrape.py | 1 + daemon/run.py | 8 ++-- daemon/scraper/bot.py | 61 +++++++------------------------ daemon/scraper/scraper.py | 4 -- daemon/scraper/utils.py | 50 +++++++++++++++++++++---- 7 files changed, 121 insertions(+), 63 deletions(-) create mode 100644 daemon/packages/__init__.py create mode 100644 daemon/packages/client.py base-commit: 339d992bdd77f19e67d0d9a30e3ac6eef1e4035a -- Muhammad Rizki