diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2010-04-11 01:39:31 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2010-04-11 01:39:31 +0200 |
commit | d9a7cd1da64da57bea05e5b234b9d9c6fea7f911 (patch) | |
tree | 65955560af923d5fc5a6517f8362903f840d13ee /portato/backend/portage | |
parent | 3c52ca58438e77d791a5cd5a2e3e0427445e93c2 (diff) | |
download | portato-d9a7cd1da64da57bea05e5b234b9d9c6fea7f911.tar.gz portato-d9a7cd1da64da57bea05e5b234b9d9c6fea7f911.tar.bz2 portato-d9a7cd1da64da57bea05e5b234b9d9c6fea7f911.zip |
applied 2to3 and fixed the result
Diffstat (limited to '')
-rw-r--r-- | portato/backend/portage/__init__.py | 2 | ||||
-rw-r--r-- | portato/backend/portage/package.py | 10 | ||||
-rw-r--r-- | portato/backend/portage/package_22.py | 2 | ||||
-rw-r--r-- | portato/backend/portage/sets.py | 8 | ||||
-rw-r--r-- | portato/backend/portage/settings.py | 2 | ||||
-rw-r--r-- | portato/backend/portage/settings_22.py | 2 | ||||
-rw-r--r-- | portato/backend/portage/system.py | 8 | ||||
-rw-r--r-- | portato/backend/portage/system_22.py | 4 |
8 files changed, 17 insertions, 21 deletions
diff --git a/portato/backend/portage/__init__.py b/portato/backend/portage/__init__.py index e559f9e..6a68bbc 100644 --- a/portato/backend/portage/__init__.py +++ b/portato/backend/portage/__init__.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import +from future_builtins import map, filter, zip from ...helper import debug from portage import VERSION as PV diff --git a/portato/backend/portage/package.py b/portato/backend/portage/package.py index 59ebe1e..5f01cad 100644 --- a/portato/backend/portage/package.py +++ b/portato/backend/portage/package.py @@ -10,8 +10,6 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import, with_statement - from ..package import Package from .. import flags from .. import system @@ -184,7 +182,7 @@ class PortagePackage (Package): return [] if deps[0] == 0: # error - raise DependencyCalcError, deps[1] + raise DependencyCalcError(deps[1]) deps = deps[1] @@ -206,7 +204,7 @@ class PortagePackage (Package): return [] if deps[0] == 0: # error - raise DependencyCalcError, deps[1] + raise DependencyCalcError(deps[1]) deps = deps[1] @@ -234,7 +232,7 @@ class PortagePackage (Package): else: dep_pkgs.append(dep) elif blocked: - raise BlockedException, (self.get_cpv(), blocked[0].get_cpv()) + raise BlockedException((self.get_cpv(), blocked[0].get_cpv())) continue # finished with the blocking one -> next @@ -242,7 +240,7 @@ class PortagePackage (Package): if not pkg: # try to find masked ones pkgs = system.find_packages(dep, masked = True) if not pkgs: - raise PackageNotFoundException, dep + raise PackageNotFoundException(dep) pkgs = system.sort_package_list(pkgs) pkgs.reverse() diff --git a/portato/backend/portage/package_22.py b/portato/backend/portage/package_22.py index 23e8ed5..61d7364 100644 --- a/portato/backend/portage/package_22.py +++ b/portato/backend/portage/package_22.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import, with_statement + from .package import PortagePackage diff --git a/portato/backend/portage/sets.py b/portato/backend/portage/sets.py index c1971b7..7bedf60 100644 --- a/portato/backend/portage/sets.py +++ b/portato/backend/portage/sets.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import, with_statement +from future_builtins import map, filter, zip import re import itertools as itt @@ -33,7 +33,7 @@ class Set(object): try: t = self.get_pkgs(key, is_regexp, masked, with_version, only_cpv) # catch the "ambigous package" Exception - except ValueError, e: + except ValueError as e: if isinstance(e[0], list): t = set() for cp in e[0]: @@ -97,7 +97,7 @@ class InstalledSet (Set): t = system.settings.vartree.dbapi.cp_all() if key: - t = filter(lambda x: re.search(key, x, re.I), t) + t = [x for x in t if re.search(key, x, re.I)] else: t = system.settings.vartree.dbapi.match(key) @@ -116,7 +116,7 @@ class TreeSet (Set): t = system.settings.porttree.dbapi.cp_all() if key: - t = filter(lambda x: re.search(key, x, re.I), t) + t = [x for x in t if re.search(key, x, re.I)] return set(t) diff --git a/portato/backend/portage/settings.py b/portato/backend/portage/settings.py index 2f3b780..0c857ac 100644 --- a/portato/backend/portage/settings.py +++ b/portato/backend/portage/settings.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import + import os import portage diff --git a/portato/backend/portage/settings_22.py b/portato/backend/portage/settings_22.py index ba4f1e8..253ecaa 100644 --- a/portato/backend/portage/settings_22.py +++ b/portato/backend/portage/settings_22.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import + import portage.sets from .settings import PortageSettings diff --git a/portato/backend/portage/system.py b/portato/backend/portage/system.py index b882237..7e70f3b 100644 --- a/portato/backend/portage/system.py +++ b/portato/backend/portage/system.py @@ -10,7 +10,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import, with_statement +from future_builtins import map, filter, zip import re, os import portage @@ -212,7 +212,7 @@ class PortageSystem (SystemInterface): result = self._get_set(pkgSet).find(key, masked, with_version, only_cpv) if (not only_cpv) and with_version: - result = map(self.new_package, result) + result = list(map(self.new_package, result)) else: result = list(result) @@ -220,7 +220,7 @@ class PortageSystem (SystemInterface): def list_categories (self, name = None): categories = self.settings.global_settings.categories - return filter(self.find_lambda(name), categories) + return list(filter(self.find_lambda(name), categories)) def split_cpv (self, cpv): cpv = portage.dep_getcpv(cpv) @@ -292,7 +292,7 @@ class PortageSystem (SystemInterface): def update_world (self, sets = ("world", "system"), newuse = False, deep = False): packages = set() - map(packages.add, itt.chain(*[self.find_packages(pkgSet = s, with_version = False) for s in sets])) + list(map(packages.add, itt.chain(*[self.find_packages(pkgSet = s, with_version = False) for s in sets]))) states = [(["RDEPEND", "PDEPEND"], True)] if self.with_bdeps(): diff --git a/portato/backend/portage/system_22.py b/portato/backend/portage/system_22.py index c3bfa5f..882232f 100644 --- a/portato/backend/portage/system_22.py +++ b/portato/backend/portage/system_22.py @@ -10,8 +10,6 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from __future__ import absolute_import, with_statement - import os import portage @@ -46,7 +44,7 @@ class PortageSystem_22 (PortageSystem): def get_sets (self, description = False): if description: - return ((name, set.description) for name, set in self.settings.setsconfig.getSets().iteritems()) + return ((name, set.description) for name, set in self.settings.setsconfig.getSets().items()) else: return tuple(self.settings.setsconfig.getSets()) |