mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated code style
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
d264e8fe65
commit
2ce923ef4e
4 changed files with 24 additions and 30 deletions
|
@ -63,6 +63,7 @@ class BinaryInstall:
|
|||
self.yellow = _meta_.color['YELLOW']
|
||||
self.endc = _meta_.color["ENDC"]
|
||||
self.msg = Msg()
|
||||
self.utils = Utils()
|
||||
self.version = self.meta.slack_rel
|
||||
self.tmp_path = self.meta.slpkg_tmp_packages
|
||||
self.init_flags()
|
||||
|
@ -159,10 +160,10 @@ class BinaryInstall:
|
|||
self.msg.template(78)
|
||||
if "--download-only" in self.flag:
|
||||
raise SystemExit()
|
||||
self.dep_install = Utils().check_downloaded(
|
||||
self.tmp_path, self.dep_install)
|
||||
self.install = Utils().check_downloaded(
|
||||
self.tmp_path, self.install)
|
||||
self.dep_install = list(self.utils.check_downloaded(
|
||||
self.tmp_path, self.dep_install))
|
||||
self.install = list(self.utils.check_downloaded(
|
||||
self.tmp_path, self.install))
|
||||
ins, upg = self.install_packages()
|
||||
self.msg.reference(ins, upg)
|
||||
write_deps(self.deps_dict)
|
||||
|
@ -188,8 +189,8 @@ class BinaryInstall:
|
|||
lowercase
|
||||
"""
|
||||
if "--case-ins" in self.flag:
|
||||
data = list(Utils().package_name(self.PACKAGES_TXT))
|
||||
data_dict = Utils().case_sensitive(data)
|
||||
data = list(self.utils.package_name(self.PACKAGES_TXT))
|
||||
data_dict = self.utils.case_sensitive(data)
|
||||
for pkg in self.packages:
|
||||
index = self.packages.index(pkg)
|
||||
for key, value in data_dict.items():
|
||||
|
@ -200,7 +201,7 @@ class BinaryInstall:
|
|||
"""Update dependencies dictionary with all package
|
||||
"""
|
||||
for dep in self.dependencies:
|
||||
deps = Utils().dimensional_list(Dependencies(
|
||||
deps = self.utils.dimensional_list(Dependencies(
|
||||
self.repo, self.blacklist).binary(
|
||||
dep, self.flag))
|
||||
self.deps_dict[dep] = deps
|
||||
|
@ -210,7 +211,7 @@ class BinaryInstall:
|
|||
or if added to install two or more times
|
||||
"""
|
||||
packages = []
|
||||
for mas in Utils().remove_dbs(self.packages):
|
||||
for mas in self.utils.remove_dbs(self.packages):
|
||||
if mas not in self.dependencies:
|
||||
packages.append(mas)
|
||||
self.packages = packages
|
||||
|
@ -264,11 +265,11 @@ class BinaryInstall:
|
|||
self.msg.resolving()
|
||||
for dep in self.packages:
|
||||
dependencies = []
|
||||
dependencies = Utils().dimensional_list(Dependencies(
|
||||
dependencies = self.utils.dimensional_list(Dependencies(
|
||||
self.repo, self.blacklist).binary(dep, self.flag))
|
||||
requires += list(self._fix_deps_repos(dependencies))
|
||||
self.deps_dict[dep] = Utils().remove_dbs(requires)
|
||||
return Utils().remove_dbs(requires)
|
||||
self.deps_dict[dep] = self.utils.remove_dbs(requires)
|
||||
return self.utils.remove_dbs(requires)
|
||||
|
||||
def _fix_deps_repos(self, dependencies):
|
||||
"""Fix store deps include in repository
|
||||
|
|
|
@ -110,8 +110,8 @@ class Patches:
|
|||
if self.msg.answer() in ["y", "Y"]:
|
||||
Download(self.patch_path, self.dwn_links,
|
||||
repo="slack").start()
|
||||
self.upgrade_all = self.utils.check_downloaded(
|
||||
self.patch_path, self.upgrade_all)
|
||||
self.upgrade_all = list(self.utils.check_downloaded(
|
||||
self.patch_path, self.upgrade_all))
|
||||
self.upgrade()
|
||||
self.kernel()
|
||||
if self.meta.slackpkg_log in ["on", "ON"]:
|
||||
|
|
|
@ -74,11 +74,9 @@ class Utils:
|
|||
"""Check if files downloaded and return downloaded
|
||||
packages
|
||||
"""
|
||||
downloaded = []
|
||||
for pkg in maybe_downloaded:
|
||||
if os.path.isfile(path + pkg):
|
||||
downloaded.append(pkg)
|
||||
return downloaded
|
||||
if os.path.isfile(f"{path}{pkg}"):
|
||||
yield pkg
|
||||
|
||||
def read_config(self, config):
|
||||
"""Read config file and returns first uncomment line
|
||||
|
@ -103,7 +101,7 @@ class Utils:
|
|||
"""Checking the file encoding default is utf-8
|
||||
"""
|
||||
try:
|
||||
with open(path + f, "r") as ftest:
|
||||
with open(f"{path}{f}", "r") as ftest:
|
||||
ftest.read()
|
||||
except UnicodeDecodeError:
|
||||
return "ISO-8859-1"
|
||||
|
|
|
@ -22,20 +22,15 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from slpkg.__metadata__ import MetaData as _meta_
|
||||
from slpkg.__metadata__ import MetaData as m
|
||||
|
||||
|
||||
def prog_version():
|
||||
"""Print version, license and email
|
||||
"""
|
||||
print("Version : {0}\n"
|
||||
"Licence : {1}\n"
|
||||
"Email : {2}\n"
|
||||
"Homepage : {3}\n"
|
||||
"Twitter : {4}\n"
|
||||
"Maintainer: {5}".format(_meta_.__version__,
|
||||
_meta_.__license__,
|
||||
_meta_.__email__,
|
||||
_meta_.__homepage__,
|
||||
_meta_.__twitter__,
|
||||
_meta_.__maintainer__))
|
||||
print(f"Version : {m.__version__}\n"
|
||||
f"Licence : {m.__license__}\n"
|
||||
f"Email : {m.__email__}\n"
|
||||
f"Homepage : {m.__homepage__}\n"
|
||||
f"Twitter : {m.__twitter__}\n"
|
||||
f"Maintainer: {m.__maintainer__}")
|
||||
|
|
Loading…
Add table
Reference in a new issue