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 1F2BA8093B; Mon, 3 Oct 2022 23:52:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1664841179; bh=4YcXXgoQZAoKHBInMVBhwwAwJu0dfeiGfH52gvkabzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ke31xjMUBnT4gDsXt7s0jgzJFPFjlaCE/kG+bn3etqW6D/nHMhejcSAdVZb/YQPnt lnXHn8xbte6VB3yXHvXNz9mwck8S6rdbKhesJThwISXtraxHdoJJ966mY16G+/w9QV DmYrVVlNlujzQdW8giEpyP4W7An7S4AZ4O32EwhL6xBl1Cg91BFDuPK2PRbCvzR28J cSmXkpn6sxdynDYcT1hDzYMtB3eNpr8bTmRZ2UjPpW+7+xAYNebPIDDOJKH7kzwhAL 57y/IVZoEdN3Vl/jq76jKNGL5/ZvsFR5rVSwZs1dUaobW0DPVFv90JywhiDD0QN2BR ghFh6d0lX3LFA== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [PATCH v2 04/28] discord: Add get_atom_urls() to get the list of atom URLs Date: Tue, 4 Oct 2022 06:52:05 +0700 Message-Id: <20221003235230.1824-5-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: 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