summaryrefslogtreecommitdiffstats
path: root/pym/portage/versions.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-12 18:07:29 -0700
committerZac Medico <zmedico@gentoo.org>2012-05-12 18:07:29 -0700
commitaf50fee789e71c1fff0b405db4cf55b618b73466 (patch)
tree3ef54d972ef77f01164b57724749d6e491732fea /pym/portage/versions.py
parent895e2cda1b83d282131eb4b12278654cc6bca141 (diff)
downloadportage-af50fee789e71c1fff0b405db4cf55b618b73466.tar.gz
portage-af50fee789e71c1fff0b405db4cf55b618b73466.tar.bz2
portage-af50fee789e71c1fff0b405db4cf55b618b73466.zip
_pkg_str: add slot and repo attributes
Diffstat (limited to 'pym/portage/versions.py')
-rw-r--r--pym/portage/versions.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index ea8d5ae57..33c7159a5 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -339,10 +339,10 @@ class _pkg_str(_unicode):
manually convert them to a plain unicode object first.
"""
- def __new__(cls, cpv, eapi=None):
+ def __new__(cls, cpv, slot=None, repo=None, eapi=None):
return _unicode.__new__(cls, cpv)
- def __init__(self, cpv, eapi=None):
+ def __init__(self, cpv, slot=None, repo=None, eapi=None):
if not isinstance(cpv, _unicode):
# Avoid TypeError from _unicode.__init__ with PyPy.
cpv = _unicode_decode(cpv)
@@ -353,6 +353,10 @@ class _pkg_str(_unicode):
self.__dict__['cp'] = self.cpv_split[0] + '/' + self.cpv_split[1]
# for match_from_list introspection
self.__dict__['cpv'] = self
+ if slot is not None:
+ self.__dict__['slot'] = slot
+ if repo is not None:
+ self.__dict__['repo'] = repo
def __setattr__(self, name, value):
raise AttributeError("_pkg_str instances are immutable",