mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Added colors to log file
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
a57589afe2
commit
83e1a48180
1 changed files with 3 additions and 6 deletions
|
@ -121,13 +121,10 @@ class Upgrade(Configs): # pylint: disable=[R0902]
|
|||
if parse(repo_version) == parse(inst_version) and int(repo_build) > int(inst_build):
|
||||
return True
|
||||
except InvalidVersion as err:
|
||||
repo_package: str = self.data[inst_name]['package']
|
||||
if repo_version > inst_version: # Try to compare the strings.
|
||||
return True
|
||||
if repo_version == inst_version and int(repo_build) > int(inst_build):
|
||||
return True
|
||||
if installed != repo_package:
|
||||
return True
|
||||
self._write_log_file(installed, inst_name, err)
|
||||
|
||||
return False
|
||||
|
@ -142,9 +139,9 @@ class Upgrade(Configs): # pylint: disable=[R0902]
|
|||
"""
|
||||
if self.log_path.is_dir():
|
||||
with self.upgrade_log_file.open('a', encoding='utf-8') as log:
|
||||
log.write(f"Installed: {installed}, "
|
||||
f"Repository: {self.data[name]['package']}, "
|
||||
f"Error: {err}, "
|
||||
log.write(f"{self.cyan}Installed{self.endc}: {installed}, "
|
||||
f"{self.yellow}Repository{self.endc}: {self.data[name]['package']}, "
|
||||
f"{self.red}Error{self.endc}: {err}, "
|
||||
f"Repo: {self.repository}\n")
|
||||
|
||||
def check_packages(self) -> None:
|
||||
|
|
Loading…
Reference in a new issue