diff options
Diffstat (limited to '')
-rw-r--r-- | portato/backend/package.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/portato/backend/package.py b/portato/backend/package.py index 34cdbe4..7fddb21 100644 --- a/portato/backend/package.py +++ b/portato/backend/package.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, paren_reduce from ..dependency import DependencyTree @@ -27,6 +27,7 @@ class Package (_Package): @type cpv: string (cat/pkg-ver)""" self._cpv = cpv + self._slot = None def __repr__ (self): return "<Package '%s' @0x%x>" % (self._cpv, id(self)) @@ -154,15 +155,26 @@ class Package (_Package): @returns: category/package. @rtype: string""" - return self.get_category()+"/"+self.get_name() + return "/".join((self.get_category(), self.get_name())) + def get_slot (self): + """Returns the slot. + + @returns: Slot + @rtype: string""" + + if self._slot is None: + self._slot = self.get_package_settings("SLOT") + + return self._slot + def get_slot_cp (self): """Returns the current cp followed by a colon and the slot-number. @returns: cp:slot @rtype: string""" - return ("%s:%s" % (self.get_cp(), self.get_package_settings("SLOT"))) + return ":".join((self.get_cp(), self.get_slot())) def get_package_path(self): """Returns the path to where the ChangeLog, Manifest, .ebuild files reside. |