mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-08 16:21:32 +00:00
Move data classes into britney2/__init__.py
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
4eb5bdb396
commit
9c563f1a96
44
britney.py
44
britney.py
@ -185,7 +185,7 @@ import optparse
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from collections import defaultdict, namedtuple
|
from collections import defaultdict
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from itertools import product
|
from itertools import product
|
||||||
from operator import attrgetter
|
from operator import attrgetter
|
||||||
@ -194,6 +194,7 @@ from urllib.parse import quote
|
|||||||
import apt_pkg
|
import apt_pkg
|
||||||
|
|
||||||
# Check the "check_field_name" reflection before removing an import here.
|
# Check the "check_field_name" reflection before removing an import here.
|
||||||
|
from britney2 import SuiteInfo, SourcePackage, BinaryPackageId, BinaryPackage
|
||||||
from britney2.consts import (SOURCE, SOURCEVER, ARCHITECTURE, CONFLICTS, DEPENDS, PROVIDES, MULTIARCH)
|
from britney2.consts import (SOURCE, SOURCEVER, ARCHITECTURE, CONFLICTS, DEPENDS, PROVIDES, MULTIARCH)
|
||||||
from britney2.excuse import Excuse
|
from britney2.excuse import Excuse
|
||||||
from britney2.hints import HintParser
|
from britney2.hints import HintParser
|
||||||
@ -227,47 +228,6 @@ check_field_name = dict((globals()[fn], fn) for fn in
|
|||||||
check_fields = sorted(check_field_name)
|
check_fields = sorted(check_field_name)
|
||||||
|
|
||||||
|
|
||||||
class SourcePackage(object):
|
|
||||||
|
|
||||||
__slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc']
|
|
||||||
|
|
||||||
def __init__(self, version, section, binaries, maintainer, is_fakesrc):
|
|
||||||
self.version = version
|
|
||||||
self.section = section
|
|
||||||
self.binaries = binaries
|
|
||||||
self.maintainer = maintainer
|
|
||||||
self.is_fakesrc = is_fakesrc
|
|
||||||
|
|
||||||
def __getitem__(self, item):
|
|
||||||
return getattr(self, self.__slots__[item])
|
|
||||||
|
|
||||||
BinaryPackageId = namedtuple('BinaryPackageId', [
|
|
||||||
'package_name',
|
|
||||||
'version',
|
|
||||||
'architecture',
|
|
||||||
])
|
|
||||||
|
|
||||||
BinaryPackage = namedtuple('BinaryPackage', [
|
|
||||||
'version',
|
|
||||||
'section',
|
|
||||||
'source',
|
|
||||||
'source_version',
|
|
||||||
'architecture',
|
|
||||||
'multi_arch',
|
|
||||||
'depends',
|
|
||||||
'conflicts',
|
|
||||||
'provides',
|
|
||||||
'is_essential',
|
|
||||||
'pkg_id',
|
|
||||||
])
|
|
||||||
|
|
||||||
SuiteInfo = namedtuple('SuiteInfo', [
|
|
||||||
'name',
|
|
||||||
'path',
|
|
||||||
'excuses_suffix',
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
class Britney(object):
|
class Britney(object):
|
||||||
"""Britney, the Debian testing updater script
|
"""Britney, the Debian testing updater script
|
||||||
|
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
|
SuiteInfo = namedtuple('SuiteInfo', [
|
||||||
|
'name',
|
||||||
|
'path',
|
||||||
|
'excuses_suffix',
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
class SourcePackage(object):
|
||||||
|
|
||||||
|
__slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc']
|
||||||
|
|
||||||
|
def __init__(self, version, section, binaries, maintainer, is_fakesrc):
|
||||||
|
self.version = version
|
||||||
|
self.section = section
|
||||||
|
self.binaries = binaries
|
||||||
|
self.maintainer = maintainer
|
||||||
|
self.is_fakesrc = is_fakesrc
|
||||||
|
|
||||||
|
def __getitem__(self, item):
|
||||||
|
return getattr(self, self.__slots__[item])
|
||||||
|
|
||||||
|
BinaryPackageId = namedtuple('BinaryPackageId', [
|
||||||
|
'package_name',
|
||||||
|
'version',
|
||||||
|
'architecture',
|
||||||
|
])
|
||||||
|
|
||||||
|
BinaryPackage = namedtuple('BinaryPackage', [
|
||||||
|
'version',
|
||||||
|
'section',
|
||||||
|
'source',
|
||||||
|
'source_version',
|
||||||
|
'architecture',
|
||||||
|
'multi_arch',
|
||||||
|
'depends',
|
||||||
|
'conflicts',
|
||||||
|
'provides',
|
||||||
|
'is_essential',
|
||||||
|
'pkg_id',
|
||||||
|
])
|
Loading…
x
Reference in New Issue
Block a user