Remove unused attributes from classes.
authorZac Medico <zmedico@gentoo.org>
Mon, 16 Aug 2010 15:55:58 +0000 (08:55 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 16 Aug 2010 15:55:58 +0000 (08:55 -0700)
pym/_emerge/Binpkg.py
pym/_emerge/EbuildBinpkg.py
pym/_emerge/EbuildBuild.py
pym/_emerge/EbuildExecuter.py
pym/_emerge/EbuildPhase.py
pym/_emerge/EbuildProcess.py
pym/_emerge/MiscFunctionsProcess.py
pym/_emerge/Scheduler.py

index 03f0e84b1e60d2db51a8aa87cecefee6f7689547..6fdc1a6f4b6948e140a3873ac277b898948dfe6e 100644 (file)
@@ -193,8 +193,8 @@ class Binpkg(CompositeTask):
                phase = "clean"
                settings = self.settings
                ebuild_phase = EbuildPhase(background=self.background,
-                       pkg=pkg, phase=phase, scheduler=self.scheduler,
-                       settings=settings, tree=self._tree)
+                       phase=phase, scheduler=self.scheduler,
+                       settings=settings)
 
                self._start_task(ebuild_phase, self._clean_exit)
 
@@ -263,8 +263,8 @@ class Binpkg(CompositeTask):
 
                phase = "setup"
                setup_phase = EbuildPhase(background=self.background,
-                       pkg=self.pkg, phase=phase, scheduler=self.scheduler,
-                       settings=settings, tree=self._tree)
+                       phase=phase, scheduler=self.scheduler,
+                       settings=settings)
 
                setup_phase.addExitListener(self._setup_exit)
                self._current_task = setup_phase
index 0ec2871af2f6e4da2051a5dfc1e80d4a41c57397..8c68d70bfadc1278feb2bdc664672814a9e13f6c 100644 (file)
@@ -12,7 +12,7 @@ class EbuildBinpkg(MiscFunctionsProcess):
        """
        This assumes that src_install() has successfully completed.
        """
-       __slots__ = ("_binpkg_tmpfile",)
+       __slots__ = ("_binpkg_tmpfile", "pkg")
 
        def __init__(self, **kwargs):
                MiscFunctionsProcess.__init__(self, phase="package", **kwargs)
index f0fdcbdbf0f146c860c15042eaf2d7110f082ca6..060c830f4e5bf90f3a6199dec1a7b638c342b261 100644 (file)
@@ -103,9 +103,7 @@ class EbuildBuild(CompositeTask):
                self.logger.log(msg, short_msg=short_msg)
 
                pre_clean_phase = EbuildPhase(background=self.background,
-                       pkg=self.pkg, phase='clean',
-                       scheduler=self.scheduler, settings=self.settings,
-                       tree=self._tree)
+                       phase='clean', scheduler=self.scheduler, settings=self.settings)
                self._start_task(pre_clean_phase, self._pre_clean_exit)
 
        def _pre_clean_exit(self, pre_clean_phase):
@@ -228,7 +226,7 @@ class EbuildBuild(CompositeTask):
                        phase = 'success_hooks'
                        success_hooks = MiscFunctionsProcess(
                                background=self.background,
-                               commands=[phase], phase=phase, pkg=self.pkg,
+                               commands=[phase], phase=phase,
                                scheduler=self.scheduler, settings=self.settings)
                        self._start_task(success_hooks,
                                self._buildpkgonly_success_hook_exit)
@@ -247,9 +245,7 @@ class EbuildBuild(CompositeTask):
                portage.elog.elog_process(self.pkg.cpv, self.settings)
                phase = 'clean'
                clean_phase = EbuildPhase(background=self.background,
-                       pkg=self.pkg, phase=phase,
-                       scheduler=self.scheduler, settings=self.settings,
-                       tree=self._tree)
+                       phase=phase, scheduler=self.scheduler, settings=self.settings)
                self._start_task(clean_phase, self._clean_exit)
 
        def _clean_exit(self, clean_phase):
index 7abcbb77e788558d443ccf123e2a681c4df78859..158099340aa762ed6b2ed80ec2416accf21354ca 100644 (file)
@@ -12,7 +12,7 @@ from portage.package.ebuild.doebuild import _prepare_env_file, \
 
 class EbuildExecuter(CompositeTask):
 
-       __slots__ = ("pkg", "scheduler", "settings") + ("_tree",)
+       __slots__ = ("pkg", "scheduler", "settings")
 
        _phases = ("prepare", "configure", "compile", "test", "install")
 
@@ -27,7 +27,6 @@ class EbuildExecuter(CompositeTask):
        ])
 
        def _start(self):
-               self._tree = "porttree"
                pkg = self.pkg
                scheduler = self.scheduler
                settings = self.settings
@@ -52,8 +51,8 @@ class EbuildExecuter(CompositeTask):
                _prepare_fake_distdir(settings, alist)
 
                setup_phase = EbuildPhase(background=self.background,
-                       pkg=pkg, phase="setup", scheduler=scheduler,
-                       settings=settings, tree=self._tree)
+                       phase="setup", scheduler=scheduler,
+                       settings=settings)
 
                setup_phase.addExitListener(self._setup_exit)
                self._current_task = setup_phase
@@ -66,8 +65,8 @@ class EbuildExecuter(CompositeTask):
                        return
 
                unpack_phase = EbuildPhase(background=self.background,
-                       pkg=self.pkg, phase="unpack", scheduler=self.scheduler,
-                       settings=self.settings, tree=self._tree)
+                       phase="unpack", scheduler=self.scheduler,
+                       settings=self.settings)
 
                if self._live_eclasses.intersection(self.pkg.inherited):
                        # Serialize $DISTDIR access for live ebuilds since
@@ -97,8 +96,8 @@ class EbuildExecuter(CompositeTask):
 
                for phase in phases:
                        ebuild_phases.add(EbuildPhase(background=self.background,
-                               pkg=self.pkg, phase=phase, scheduler=self.scheduler,
-                               settings=self.settings, tree=self._tree))
+                               phase=phase, scheduler=self.scheduler,
+                               settings=self.settings))
 
                self._start_task(ebuild_phases, self._default_final_exit)
 
index 8d20fd8788ae2bb88971f4d26a77907e865ac48f..55f50b3dbbde23d214dcca5270ccda0354d7c52d 100644 (file)
@@ -17,14 +17,14 @@ import codecs
 
 class EbuildPhase(CompositeTask):
 
-       __slots__ = ("background", "pkg", "phase",
-               "scheduler", "settings", "tree")
+       __slots__ = ("background", "phase",
+               "scheduler", "settings")
 
        def _start(self):
 
                ebuild_process = EbuildProcess(background=self.background,
-                       pkg=self.pkg, phase=self.phase, scheduler=self.scheduler,
-                       settings=self.settings, tree=self.tree)
+                       phase=self.phase, scheduler=self.scheduler,
+                       settings=self.settings)
 
                self._start_task(ebuild_process, self._ebuild_exit)
 
@@ -77,7 +77,7 @@ class EbuildPhase(CompositeTask):
                post_phase_cmds = _post_phase_cmds.get(self.phase)
                if post_phase_cmds is not None:
                        post_phase = MiscFunctionsProcess(background=self.background,
-                               commands=post_phase_cmds, phase=self.phase, pkg=self.pkg,
+                               commands=post_phase_cmds, phase=self.phase,
                                scheduler=self.scheduler, settings=settings)
                        self._start_task(post_phase, self._post_phase_exit)
                        return
@@ -100,7 +100,7 @@ class EbuildPhase(CompositeTask):
                self.returncode = None
                phase = 'die_hooks'
                die_hooks = MiscFunctionsProcess(background=self.background,
-                       commands=[phase], phase=phase, pkg=self.pkg,
+                       commands=[phase], phase=phase,
                        scheduler=self.scheduler, settings=self.settings)
                self._start_task(die_hooks, self._die_hooks_exit)
 
@@ -117,12 +117,10 @@ class EbuildPhase(CompositeTask):
 
        def _fail_clean(self):
                self.returncode = None
-               portage.elog.elog_process(self.pkg.cpv, self.settings)
+               portage.elog.elog_process(self.settings.mycpv, self.settings)
                phase = "clean"
                clean_phase = EbuildPhase(background=self.background,
-                       pkg=self.pkg, phase=phase,
-                       scheduler=self.scheduler, settings=self.settings,
-                       tree=self.tree)
+                       phase=phase, scheduler=self.scheduler, settings=self.settings)
                self._start_task(clean_phase, self._fail_clean_exit)
                return
 
index bd0e0d6fcfa025972697aa82dfa91f074f2ac823..2d4d61b1b8e9a474e269e43c27b44f3f50a636f6 100644 (file)
@@ -11,7 +11,7 @@ from portage.package.ebuild.doebuild import _spawn_actionmap
 
 class EbuildProcess(AbstractEbuildProcess):
 
-       __slots__ = ('pkg', 'tree',)
+       __slots__ = ()
 
        def _start(self):
                # Don't open the log file during the clean phase since the
index 04445a89d825aa7452ce77b1f22dab00f7357a8a..270da427737b026b62c5aecb0835b9d2967c9192 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.AbstractEbuildProcess import AbstractEbuildProcess
@@ -11,7 +11,7 @@ class MiscFunctionsProcess(AbstractEbuildProcess):
        Spawns misc-functions.sh with an existing ebuild environment.
        """
 
-       __slots__ = ('commands', 'pkg',)
+       __slots__ = ('commands',)
 
        def _start(self):
                settings = self.settings
index ae9cbcaa87ccc5e534d6196d4185deb91960508b..6d7dbd9c350ca3b128cc3b7d1d8889efabff5593 100644 (file)
@@ -21,7 +21,7 @@ from portage import _unicode_encode
 from portage.cache.mappings import slot_dict_class
 from portage.const import LIBC_PACKAGE_ATOM
 from portage.elog.messages import eerror
-from portage.output import colorize, create_color_func, darkgreen, red
+from portage.output import colorize, create_color_func, red
 bad = create_color_func("BAD")
 from portage.sets import SETPREFIX
 from portage.sets.base import InternalPackageSet
@@ -623,12 +623,12 @@ class Scheduler(PollScheduler):
 
                if phase in ('die_hooks', 'success_hooks'):
                        ebuild_phase = MiscFunctionsProcess(background=background,
-                               commands=[phase], phase=phase, pkg=pkg,
+                               commands=[phase], phase=phase,
                                scheduler=scheduler, settings=settings)
                else:
                        ebuild_phase = EbuildPhase(background=background,
-                               pkg=pkg, phase=phase, scheduler=scheduler,
-                               settings=settings, tree=pkg_dblink.treetype)
+                               phase=phase, scheduler=scheduler,
+                               settings=settings)
                ebuild_phase.start()
                ebuild_phase.wait()
 
@@ -915,9 +915,9 @@ class Scheduler(PollScheduler):
                                debug=(settings.get("PORTAGE_DEBUG", "") == 1),
                                mydbapi=self.trees[settings["ROOT"]][tree].dbapi, use_cache=1)
                        prepare_build_dirs(root_config.root, settings, cleanup=0)
-                       pretend_phase = EbuildPhase(background=self._background, pkg=x,
+                       pretend_phase = EbuildPhase(background=self._background,
                                phase="pretend", scheduler=self._sched_iface,
-                               settings=settings, tree=tree)
+                               settings=settings)
 
                        pretend_phase.start()
                        ret = pretend_phase.wait()