mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-11-16 07:47:35 +01:00
Updated json format
Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
parent
1e5254535c
commit
48ebec6a4f
1 changed files with 5 additions and 2 deletions
|
@ -28,6 +28,7 @@ class Upgrade(Configs): # pylint: disable=[R0902]
|
|||
self.load_data = LoadData()
|
||||
|
||||
self.id: int = 0
|
||||
self.log_id: int = 0
|
||||
self.sum_upgrade: int = 0
|
||||
self.sum_removed: int = 0
|
||||
self.sum_added: int = 0
|
||||
|
@ -138,13 +139,15 @@ class Upgrade(Configs): # pylint: disable=[R0902]
|
|||
name (str): Package name.
|
||||
err (InvalidVersion): InvalidVersion error.
|
||||
"""
|
||||
self.log_id += 1
|
||||
log: dict = {}
|
||||
if self.upgrade_log_file.is_file():
|
||||
log: dict = self.utils.read_json_file(self.upgrade_log_file)
|
||||
|
||||
log[installed]: dict = {
|
||||
'repo name': self.repository,
|
||||
log[self.log_id]: dict = {
|
||||
'installed': installed,
|
||||
'repo package': self.data[name]['package'],
|
||||
'repo name': self.repository,
|
||||
'error': str(err)
|
||||
}
|
||||
self.upgrade_log_file.write_text(json.dumps(log, indent=4), encoding='utf-8')
|
||||
|
|
Loading…
Reference in a new issue