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.177]) by gnuweeb.org (Postfix) with ESMTPSA id 1B56280FBA; Sat, 1 Oct 2022 13:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664629457; bh=4YcXXgoQZAoKHBInMVBhwwAwJu0dfeiGfH52gvkabzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KTfpAK1M4n+G28yGc4TQhf5USRjPht8W8BY165DDEQzqe55xoUHcVN95w2eceDsRk A0bNVitdffuj1ihnqnMVPG+nKEJqFWbsZF9oKhWVsSJNX7MW87Olpzmy4K6AKpFZHJ WWhsDhttEyNpuOCPC8BRfvPgHc2i6rUhsc5Ez5m94rHt76iEx7CEYQngiu/Me37cOO JJnryOiWQ+j5B+8nRtRJ2eto8u/Lanqy0ujN0GpuR/LnmIhkv5EEkL8pSxq8OuQWyC R+MJqRuEpotrr5uxtQNP9WnWC6Z5KlIlMJpCoKDZGiPgCZZ/xzShTcujinWZKJJgnI MfO3mi3MdUPOw== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v1 01/26] discord: Add get_atom_urls() to get the list of atom URLs Date: Sat, 1 Oct 2022 20:03:29 +0700 Message-Id: <20221001130355.784-2-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20221001130355.784-1-kiizuha@gnuweeb.org> References: <20221001130355.784-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add get_atom_urls() in the database getter directory to get the list of atom URLs. With this, we can display and manage them. Signed-off-by: Muhammad Rizki --- .../database/methods/getter/__init__.py | 12 +++++++++++ .../database/methods/getter/get_atom_urls.py | 21 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 daemon/dscord/database/methods/getter/__init__.py create mode 100644 daemon/dscord/database/methods/getter/get_atom_urls.py diff --git a/daemon/dscord/database/methods/getter/__init__.py b/daemon/dscord/database/methods/getter/__init__.py new file mode 100644 index 0000000..3670448 --- /dev/null +++ b/daemon/dscord/database/methods/getter/__init__.py @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2022 Muhammad Rizki +# + + +from .get_atom_urls import GetAtomURL + + +class Getter( + GetAtomURL +): pass diff --git a/daemon/dscord/database/methods/getter/get_atom_urls.py b/daemon/dscord/database/methods/getter/get_atom_urls.py new file mode 100644 index 0000000..19fe49e --- /dev/null +++ b/daemon/dscord/database/methods/getter/get_atom_urls.py @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2022 Muhammad Rizki +# + + +class GetAtomURL: + + def get_atom_urls(self): + ''' + Get lore kernel raw email URLs. + - Return list of raw email URLs: `List[str]` + ''' + q = """ + SELECT dc_atoms.url + FROM dc_atoms + """ + self.cur.execute(q) + urls = self.cur.fetchall() + + return [u[0] for u in urls] -- Muhammad Rizki