From 1bf45547b20920d9f5cedd080f61c1d884aee552 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Sat, 12 Mar 2022 11:45:18 -0300 Subject: [PATCH] [arch] refactoring: 'orphan' as a property --- bauh/gems/arch/controller.py | 4 ++-- bauh/gems/arch/model.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index aff6fa62..d638d9e8 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -1466,7 +1466,7 @@ class ArchManager(SoftwareManager): if info is not None: self._parse_dates_string_from_info(pkg.name, info) - info['04_orphan'] = pkg.maintainer is None + info['04_orphan'] = pkg.orphan info['04_out_of_date'] = pkg.out_of_date if pkg.commit: @@ -1490,7 +1490,7 @@ class ArchManager(SoftwareManager): '02_name': pkg.name, '03_description': pkg.description, '03_version': pkg.version, - '04_orphan': pkg.maintainer is None, + '04_orphan': pkg.orphan, '04_out_of_date': pkg.out_of_date, '04_popularity': pkg.popularity, '05_votes': pkg.votes, diff --git a/bauh/gems/arch/model.py b/bauh/gems/arch/model.py index 98e987dc..674e4bd5 100644 --- a/bauh/gems/arch/model.py +++ b/bauh/gems/arch/model.py @@ -271,3 +271,7 @@ class ArchPackage(SoftwarePackage): return hash((self.view_name, self.repository)) else: return hash((self.name, self.repository)) + + @property + def orphan(self) -> bool: + return self.maintainer is None