diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-14 09:37:43 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-14 09:37:43 -0700 |
commit | e6d4420784da14df61ec6cc1cf16bf7b539354cb (patch) | |
tree | af56ad4b9d2043d29edf75383df76e07447706a4 /pym/_emerge/AbstractEbuildProcess.py | |
parent | e38aa7eef4b9ddf873cc0958ef4511e4577106ff (diff) | |
download | portage-e6d4420784da14df61ec6cc1cf16bf7b539354cb.tar.gz portage-e6d4420784da14df61ec6cc1cf16bf7b539354cb.tar.bz2 portage-e6d4420784da14df61ec6cc1cf16bf7b539354cb.zip |
Move 'phase' attribute to AbstractEbuildProcess from subclasses, so
the _get_phase() method isn't needed.
Diffstat (limited to 'pym/_emerge/AbstractEbuildProcess.py')
-rw-r--r-- | pym/_emerge/AbstractEbuildProcess.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 21fd88038..0dec65036 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -19,21 +19,21 @@ from portage.util import writemsg_stdout class AbstractEbuildProcess(SpawnProcess): - __slots__ = ('settings',) + \ + __slots__ = ('phase', 'settings',) + \ ('_ipc_daemon', '_exit_command',) _phases_without_builddir = ('clean', 'cleanrm', 'depend', 'help',) - def _get_phase(self): - phase = getattr(self, 'phase', None) - if not phase: + def __init__(self, **kwargs): + SpawnProcess.__init__(self, **kwargs) + if self.phase is None: phase = self.settings.get("EBUILD_PHASE") if not phase: phase = 'other' - return phase + self.phase = phase def _start(self): - if self._get_phase() not in self._phases_without_builddir: + if self.phase not in self._phases_without_builddir: self.settings['PORTAGE_IPC_DAEMON'] = "1" self._exit_command = ExitCommand() self._exit_command.reply_hook = self._exit_command_callback @@ -71,7 +71,7 @@ class AbstractEbuildProcess(SpawnProcess): self.cancel() def _orphan_process_warn(self): - phase = self._get_phase() + phase = self.phase msg = _("The ebuild phase '%s' with pid %s appears " "to have left an orphan process running in the " @@ -94,7 +94,7 @@ class AbstractEbuildProcess(SpawnProcess): def _unexpected_exit(self): - phase = self._get_phase() + phase = self.phase msg = _("The ebuild phase '%s' has exited " "unexpectedly. This type of behavior " @@ -120,7 +120,7 @@ class AbstractEbuildProcess(SpawnProcess): def _eerror(self, lines): out = StringIO() - phase = self._get_phase() + phase = self.phase for line in lines: eerror(line, phase=phase, key=self.settings.mycpv, out=out) logfile = self.logfile |