Removed unused old code

This commit is contained in:
Dimitris Zlatanidis 2022-05-29 17:18:47 +03:00
parent 37736f7847
commit 2079814560

View file

@ -35,20 +35,9 @@ class SBoGrep(Utils):
self.meta = _meta_
self.db = self.meta.db
self.arch64 = "x86_64"
self.line_name = "SLACKBUILD NAME: "
self.line_files = "SLACKBUILD FILES: "
self.line_down = "SLACKBUILD DOWNLOAD: "
self.line_down_64 = f"SLACKBUILD DOWNLOAD_{self.arch64}: "
self.line_req = "SLACKBUILD REQUIRES: "
self.line_ver = "SLACKBUILD VERSION: "
self.line_md5 = "SLACKBUILD MD5SUM: "
self.line_md5_64 = f"SLACKBUILD MD5SUM_{self.arch64}: "
self.line_des = "SLACKBUILD SHORT DESCRIPTION: "
self.sbo_txt = self.meta.lib_path + "sbo_repo/SLACKBUILDS.TXT"
self.sbo_db = f"{self.meta.lib_path}database/{self.db}"
self.con = sqlite3.connect(self.sbo_db)
self.cur = self.con.cursor()
self.SLACKBUILDS_TXT = self.read_file(self.sbo_txt)
def _names_grabbing(self):
"""Generator that collecting all packages names
@ -57,10 +46,6 @@ class SBoGrep(Utils):
for n in names:
yield n[0]
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# yield line[17:].strip()
def names(self):
"""Alias method convert generator and return
a list
@ -70,16 +55,6 @@ class SBoGrep(Utils):
def source(self):
"""Grab sources downloads links
"""
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# sbo_name = line[17:].strip()
# if line.startswith(self.line_down):
# if sbo_name == self.name and line[21:].strip():
# source = line[21:]
# if line.startswith(self.line_down_64):
# if sbo_name == self.name and line[28:].strip():
# source64 = line[28:]
source, source64 = self.cur.execute("""SELECT download, download64
FROM sbo
WHERE name = '{}'""".format(
@ -95,14 +70,6 @@ class SBoGrep(Utils):
self.name)).fetchone()
return requires[0].split()
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# sbo_name = line[17:].strip()
# if line.startswith(self.line_req):
# if sbo_name == self.name:
# # print(line[21:].strip().split())
# return line[21:].strip().split()
def version(self):
"""Grab package version
"""
@ -112,15 +79,6 @@ class SBoGrep(Utils):
self.name)).fetchone()
return version[0]
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# sbo_name = line[17:].strip()
# if line.startswith(self.line_ver):
# if sbo_name == self.name:
# print(line[20:].strip())
#
# return line[20:].strip()
def checksum(self):
"""Grab checksum string
"""
@ -135,19 +93,6 @@ class SBoGrep(Utils):
md5sum64.append(md5s64)
return self._sorting_arch(md5sum, md5sum64)
# md5sum, md5sum64, = [], []
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# sbo_name = line[17:].strip()
# if line.startswith(self.line_md5_64):
# if sbo_name == self.name and line[26:].strip():
# md5sum64 = line[26:].strip().split()
# if line.startswith(self.line_md5):
# if sbo_name == self.name and line[19:].strip():
# md5sum = line[19:].strip().split()
# print(md5sum, md5sum64)
# return self._sorting_arch(md5sum, md5sum64)
def description(self):
"""Grab package description
"""
@ -157,15 +102,6 @@ class SBoGrep(Utils):
self.name)).fetchone()
return desc[0]
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# sbo_name = line[17:].strip()
# if line.startswith(self.line_des):
# if sbo_name == self.name:
# print(line[31:].strip())
#
# return line[31:].strip()
def files(self):
"""Grab files
"""
@ -175,13 +111,6 @@ class SBoGrep(Utils):
self.name)).fetchone()
return files[0]
# for line in self.SLACKBUILDS_TXT.splitlines():
# if line.startswith(self.line_name):
# sbo_name = line[17:].strip()
# if line.startswith(self.line_files):
# if sbo_name == self.name:
# return line[18:].strip()
def _sorting_arch(self, arch, arch64):
"""Return sources by arch
"""