Remove now obsolete code from MigrationItem

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent 61d3068de6
commit 542f030a96
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -285,8 +285,6 @@ class Britney(object):
self.policies = []
self.suite_info = None # Initialized during __parse_arguments
self.__parse_arguments()
MigrationItem.set_architectures(self.options.architectures)
MigrationItem.set_suites(self.suite_info)
self.all_selected = []
self.excuses = {}

@ -18,28 +18,8 @@ from britney2 import SuiteClass
class MigrationItem(object):
_architectures = []
_suites = None
@classmethod
def set_architectures(cls, architectures=None):
cls._architectures = architectures or []
@classmethod
def get_architectures(cls):
return cls._architectures
@classmethod
def set_suites(cls, suites):
cls._suites = suites
@classmethod
def get_suites(cls):
return cls._suites
def __init__(self, versionned=True, package=None, version=None, architecture=None, uvname=None, suite=None):
self._versionned = versionned
def __init__(self, package=None, version=None, architecture=None, uvname=None, suite=None):
self._uvname = uvname
self._package = package
self._version = version
@ -51,7 +31,7 @@ class MigrationItem(object):
self._name = uvname
def __str__(self):
if self._versionned and self.version is not None:
if self.version is not None:
return self.name
else:
return self.uvname
@ -76,22 +56,6 @@ class MigrationItem(object):
def name(self):
return self._name
def _canonicalise_name(self):
parts = self._name.split('/', 3)
is_removal = self.is_removal
if len(parts) == 1 or self._architecture == 'source':
self._uvname = self._package
else:
self._uvname = "%s/%s" % (self._package, self._architecture)
if self._suite.suite_class.is_additional_source:
self._uvname = '%s_%s' % (self._uvname, self._suite.suite_short_name)
if is_removal:
self._uvname = '-%s' % (self._uvname)
if self._versionned:
self._name = '%s/%s' % (self._uvname, self._version)
else:
self._name = self._uvname
@property
def is_removal(self):
return self._name.startswith('-')
@ -108,11 +72,6 @@ class MigrationItem(object):
def suite(self):
return self._suite
@suite.setter
def suite(self, value):
self._suite = self.__class__._suites[value]
self._canonicalise_name()
@property
def version(self):
return self._version

Loading…
Cancel
Save