Refactor all modules into a britney2 subdir

That way they are all contained.

Signed-off-by: Niels Thykier <niels@thykier.net>
email-direct-upload-sponsor
Niels Thykier 8 years ago
parent 2bc523169b
commit 9bc94db01c

@ -181,38 +181,34 @@ does for the generation of the update excuses.
""" """
from __future__ import print_function from __future__ import print_function
import optparse
import os import os
import sys import sys
import time import time
import optparse
import apt_pkg
from collections import defaultdict, namedtuple from collections import defaultdict, namedtuple
from functools import reduce from functools import reduce
from itertools import product from itertools import product
from operator import attrgetter from operator import attrgetter
from urllib.parse import quote from urllib.parse import quote
from installability.builder import InstallabilityTesterBuilder import apt_pkg
from excuse import Excuse
from migrationitem import MigrationItem
from hints import HintParser
from britney_util import (old_libraries_format, undo_changes,
compute_reverse_tree, possibly_compressed,
read_nuninst, write_nuninst, write_heidi,
eval_uninst, newly_uninst, make_migrationitem,
write_excuses, write_heidi_delta, write_controlfiles,
old_libraries, is_nuninst_asgood_generous,
clone_nuninst, check_installability,
create_provides_map,
)
from policies.policy import AgePolicy, RCBugPolicy, PolicyVerdict
# Check the "check_field_name" reflection before removing an import here. # Check the "check_field_name" reflection before removing an import here.
from consts import (SOURCE, SOURCEVER, ARCHITECTURE, CONFLICTS, DEPENDS, from britney2.consts import (SOURCE, SOURCEVER, ARCHITECTURE, CONFLICTS, DEPENDS, PROVIDES, MULTIARCH)
PROVIDES, MULTIARCH) from britney2.excuse import Excuse
from britney2.hints import HintParser
from britney2.installability.builder import InstallabilityTesterBuilder
from britney2.migrationitem import MigrationItem
from britney2.policies.policy import AgePolicy, RCBugPolicy, PolicyVerdict
from britney2.utils import (old_libraries_format, undo_changes,
compute_reverse_tree, possibly_compressed,
read_nuninst, write_nuninst, write_heidi,
eval_uninst, newly_uninst, make_migrationitem,
write_excuses, write_heidi_delta, write_controlfiles,
old_libraries, is_nuninst_asgood_generous,
clone_nuninst, check_installability,
create_provides_map,
)
__author__ = 'Fabio Tranchitella and the Debian Release Team' __author__ = 'Fabio Tranchitella and the Debian Release Team'
__version__ = '2.0' __version__ = '2.0'
@ -1642,7 +1638,7 @@ class Britney(object):
# uploads to (t-)p-u which intentionally drop binary # uploads to (t-)p-u which intentionally drop binary
# packages # packages
if any(x for x in self.binaries[suite][arch][0].values() \ if any(x for x in self.binaries[suite][arch][0].values() \
if x.source == src and x.source_version == source_u.version and \ if x.source == src and x.source_version == source_u.version and \
x.architecture != 'all'): x.architecture != 'all'):
continue continue
@ -2778,7 +2774,7 @@ class Britney(object):
self.nuninst_orig_save = self.get_nuninst() self.nuninst_orig_save = self.get_nuninst()
import readline import readline
from completer import Completer from britney2.completer import Completer
histfile = os.path.expanduser('~/.britney2_history') histfile = os.path.expanduser('~/.britney2_history')
if os.path.exists(histfile): if os.path.exists(histfile):

@ -16,7 +16,7 @@ from __future__ import print_function
from itertools import chain from itertools import chain
from migrationitem import MigrationItem from britney2.migrationitem import MigrationItem
class MalformedHintException(Exception): class MalformedHintException(Exception):

@ -15,8 +15,9 @@
from collections import defaultdict from collections import defaultdict
from contextlib import contextmanager from contextlib import contextmanager
from britney_util import ifilter_except, iter_except from britney2.utils import ifilter_except, iter_except
from installability.solver import InstallabilitySolver from britney2.installability.solver import InstallabilitySolver
class _RelationBuilder(object): class _RelationBuilder(object):
"""Private helper class to "build" relations""" """Private helper class to "build" relations"""

@ -19,8 +19,8 @@ from __future__ import print_function
import os import os
from collections import deque from collections import deque
from installability.tester import InstallabilityTester from britney2.utils import (ifilter_only, iter_except)
from britney_util import (ifilter_only, iter_except) from britney2.installability.tester import InstallabilityTester
class InstallabilitySolver(InstallabilityTester): class InstallabilitySolver(InstallabilityTester):

@ -16,7 +16,7 @@ from collections import defaultdict
from functools import partial from functools import partial
from itertools import chain, filterfalse from itertools import chain, filterfalse
from britney_util import iter_except from britney2.utils import iter_except
class InstallabilityTester(object): class InstallabilityTester(object):

@ -144,6 +144,7 @@ class MigrationItem(object):
def uvname(self): def uvname(self):
return self._uvname return self._uvname
class UnversionnedMigrationItem(MigrationItem): class UnversionnedMigrationItem(MigrationItem):
def __init__(self, name=None): def __init__(self, name=None):
super().__init__(name=name, versionned=False) super().__init__(name=name, versionned=False)

@ -1,11 +1,12 @@
from abc import abstractmethod
from enum import Enum, unique
import apt_pkg
import os import os
import time import time
from abc import abstractmethod
from enum import Enum, unique
from urllib.parse import quote from urllib.parse import quote
from hints import Hint, split_into_one_hint_per_package import apt_pkg
from britney2.hints import Hint, split_into_one_hint_per_package
@unique @unique
@ -93,7 +94,6 @@ class BasePolicy(object):
""" """
pass pass
def apply_policy(self, general_policy_info, suite, source_name, source_data_tdist, source_data_srcdist, excuse): def apply_policy(self, general_policy_info, suite, source_name, source_data_tdist, source_data_srcdist, excuse):
if self.policy_id not in general_policy_info: if self.policy_id not in general_policy_info:
general_policy_info[self.policy_id] = pinfo = {} general_policy_info[self.policy_id] = pinfo = {}

@ -21,21 +21,21 @@
# GNU General Public License for more details. # GNU General Public License for more details.
import errno
import os
import time
from collections import defaultdict from collections import defaultdict
from functools import partial
from datetime import datetime from datetime import datetime
from functools import partial
from itertools import filterfalse from itertools import filterfalse
import os
import time
import yaml
import errno
from migrationitem import MigrationItem, UnversionnedMigrationItem import yaml
from consts import (VERSION, PROVIDES, DEPENDS, CONFLICTS, from britney2.consts import (VERSION, PROVIDES, DEPENDS, CONFLICTS,
ARCHITECTURE, SECTION, ARCHITECTURE, SECTION,
SOURCE, MAINTAINER, MULTIARCH, SOURCE, MAINTAINER, MULTIARCH,
ESSENTIAL) ESSENTIAL)
from britney2.migrationitem import MigrationItem, UnversionnedMigrationItem
def ifilter_except(container, iterable=None): def ifilter_except(container, iterable=None):
Loading…
Cancel
Save