From 6e6ef6f87f8cb2d51a53b2d4417c4b370f7ca495 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 17 Feb 2012 14:49:36 -0800 Subject: [PATCH] Move _emerge.SlotObject to portage.util. --- pym/_emerge/AbstractDepPriority.py | 4 ++-- pym/_emerge/AsynchronousTask.py | 5 +++-- pym/_emerge/Dependency.py | 5 +++-- pym/_emerge/EbuildBuildDir.py | 5 +++-- pym/_emerge/EbuildFetchonly.py | 4 ++-- pym/_emerge/PollScheduler.py | 2 +- pym/_emerge/Scheduler.py | 2 +- pym/_emerge/SequentialTaskQueue.py | 6 ++++-- pym/_emerge/Task.py | 5 +++-- pym/{_emerge => portage/util}/SlotObject.py | 0 pym/portage/util/_eventloop/EventLoop.py | 2 +- 11 files changed, 23 insertions(+), 17 deletions(-) rename pym/{_emerge => portage/util}/SlotObject.py (100%) diff --git a/pym/_emerge/AbstractDepPriority.py b/pym/_emerge/AbstractDepPriority.py index 94a9379a5..94f26efc5 100644 --- a/pym/_emerge/AbstractDepPriority.py +++ b/pym/_emerge/AbstractDepPriority.py @@ -1,8 +1,8 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import copy -from _emerge.SlotObject import SlotObject +from portage.util.SlotObject import SlotObject class AbstractDepPriority(SlotObject): __slots__ = ("buildtime", "runtime", "runtime_post") diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py index a1467b0b5..df72bae55 100644 --- a/pym/_emerge/AsynchronousTask.py +++ b/pym/_emerge/AsynchronousTask.py @@ -1,8 +1,9 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage import os -from _emerge.SlotObject import SlotObject +from portage.util.SlotObject import SlotObject + class AsynchronousTask(SlotObject): """ Subclasses override _wait() and _poll() so that calls diff --git a/pym/_emerge/Dependency.py b/pym/_emerge/Dependency.py index 0f746b66f..c2d36b2dc 100644 --- a/pym/_emerge/Dependency.py +++ b/pym/_emerge/Dependency.py @@ -1,8 +1,9 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +from portage.util.SlotObject import SlotObject from _emerge.DepPriority import DepPriority -from _emerge.SlotObject import SlotObject + class Dependency(SlotObject): __slots__ = ("atom", "blocker", "child", "depth", "parent", "onlydeps", "priority", "root", diff --git a/pym/_emerge/EbuildBuildDir.py b/pym/_emerge/EbuildBuildDir.py index ddc5fe0b4..9773bd790 100644 --- a/pym/_emerge/EbuildBuildDir.py +++ b/pym/_emerge/EbuildBuildDir.py @@ -1,11 +1,12 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from _emerge.AsynchronousLock import AsynchronousLock -from _emerge.SlotObject import SlotObject + import portage from portage import os from portage.exception import PortageException +from portage.util.SlotObject import SlotObject import errno class EbuildBuildDir(SlotObject): diff --git a/pym/_emerge/EbuildFetchonly.py b/pym/_emerge/EbuildFetchonly.py index d0f954c24..f88ea96ef 100644 --- a/pym/_emerge/EbuildFetchonly.py +++ b/pym/_emerge/EbuildFetchonly.py @@ -1,10 +1,10 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from _emerge.SlotObject import SlotObject import portage from portage import os from portage.elog.messages import eerror +from portage.util.SlotObject import SlotObject class EbuildFetchonly(SlotObject): diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py index be41565dd..8f0183805 100644 --- a/pym/_emerge/PollScheduler.py +++ b/pym/_emerge/PollScheduler.py @@ -12,9 +12,9 @@ except ImportError: from portage import _encodings from portage import _unicode_encode from portage.util import writemsg_level +from portage.util.SlotObject import SlotObject from portage.util._eventloop.global_event_loop import global_event_loop -from _emerge.SlotObject import SlotObject from _emerge.getloadavg import getloadavg class PollScheduler(object): diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index c797c3241..b76d9ee96 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -27,6 +27,7 @@ bad = create_color_func("BAD") from portage._sets import SETPREFIX from portage._sets.base import InternalPackageSet from portage.util import ensure_dirs, writemsg, writemsg_level +from portage.util.SlotObject import SlotObject from portage.package.ebuild.digestcheck import digestcheck from portage.package.ebuild.digestgen import digestgen from portage.package.ebuild.doebuild import (_check_temp_dir, @@ -56,7 +57,6 @@ from _emerge.MergeListItem import MergeListItem from _emerge.Package import Package from _emerge.PackageMerge import PackageMerge from _emerge.PollScheduler import PollScheduler -from _emerge.SlotObject import SlotObject from _emerge.SequentialTaskQueue import SequentialTaskQueue if sys.hexversion >= 0x3000000: diff --git a/pym/_emerge/SequentialTaskQueue.py b/pym/_emerge/SequentialTaskQueue.py index ebff430e3..80908936c 100644 --- a/pym/_emerge/SequentialTaskQueue.py +++ b/pym/_emerge/SequentialTaskQueue.py @@ -1,9 +1,11 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -import sys -from _emerge.SlotObject import SlotObject from collections import deque +import sys + +from portage.util.SlotObject import SlotObject + class SequentialTaskQueue(SlotObject): __slots__ = ("max_jobs", "running_tasks") + \ diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py index efbe3a99d..40f5066c0 100644 --- a/pym/_emerge/Task.py +++ b/pym/_emerge/Task.py @@ -1,7 +1,8 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from _emerge.SlotObject import SlotObject +from portage.util.SlotObject import SlotObject + class Task(SlotObject): __slots__ = ("_hash_key", "_hash_value") diff --git a/pym/_emerge/SlotObject.py b/pym/portage/util/SlotObject.py similarity index 100% rename from pym/_emerge/SlotObject.py rename to pym/portage/util/SlotObject.py diff --git a/pym/portage/util/_eventloop/EventLoop.py b/pym/portage/util/_eventloop/EventLoop.py index 9e4ac28a2..763d3afd4 100644 --- a/pym/portage/util/_eventloop/EventLoop.py +++ b/pym/portage/util/_eventloop/EventLoop.py @@ -10,8 +10,8 @@ import signal import time from portage.util import writemsg_level +from portage.util.SlotObject import SlotObject -from _emerge.SlotObject import SlotObject from _emerge.PollConstants import PollConstants from _emerge.PollSelectAdapter import PollSelectAdapter -- 2.26.2