From 1e7a372d814915c4f4aa4b698c258357e9082b0d Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Tue, 15 Nov 2011 20:45:51 +0000 Subject: [PATCH] MigrationItem: make the "suite" property read/write Changing the suite requires update the item's canonical names, as these need to reflect the new suite. The property() function only applies to new-style classes, so we also need to update MigrationItem to be new-style. Signed-off-by: Adam D. Barratt --- migrationitem.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/migrationitem.py b/migrationitem.py index c2b1736..0acccd6 100644 --- a/migrationitem.py +++ b/migrationitem.py @@ -12,7 +12,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -class MigrationItem: +class MigrationItem(object): _architectures = [] @classmethod @@ -124,10 +124,15 @@ class MigrationItem: def package(self): return self._package - @property - def suite(self): + def _get_suite(self): return self._suite + def _set_suite(self, value): + self._suite = value + self._canonicalise_name() + + suite = property(_get_suite, _set_suite) + @property def version(self): return self._version