summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-02-10 18:15:24 +0000
committerAlec Warner <antarus@gentoo.org>2007-02-10 18:15:24 +0000
commit662e913455dc14125a95792fea3287cb1de27f1a (patch)
tree4a9b9f73227ac2bc3d96858210654e24e777b944
parent06d258a3f93ed66b0b84cd2c92960cde57407a32 (diff)
downloadportage-662e913455dc14125a95792fea3287cb1de27f1a.tar.gz
portage-662e913455dc14125a95792fea3287cb1de27f1a.tar.bz2
portage-662e913455dc14125a95792fea3287cb1de27f1a.zip
add docstrings
svn path=/main/trunk/; revision=5938
-rw-r--r--pym/portage/dep.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 6b38e8eed..468b997be 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -24,6 +24,25 @@ from portage.exception import InvalidData, InvalidAtom
from portage.versions import catpkgsplit, catsplit, pkgcmp, pkgsplit, ververify
def cpvequal(cpv1, cpv2):
+ """
+
+ @param cpv1: CategoryPackageVersion (no operators) Example: "sys-apps/portage-2.1"
+ @type cpv1: String
+ @param cpv2: CategoryPackageVersion (no operators) Example: "sys-apps/portage-2.1"
+ @type cpv2: String
+ @rtype: Boolean
+ @returns:
+ 1. True if cpv1 = cpv2
+ 2. False Otherwise
+ 3. Throws PortageException if cpv1 or cpv2 is not a CPV
+
+ Example Usage:
+ >>> from portage.dep import cpvequal
+ >>> cpvequal("sys-apps/portage-2.1","sys-apps/portage-2.1")
+ >>> True
+
+ """
+
split1 = catpkgsplit(cpv1)
split2 = catpkgsplit(cpv2)
@@ -44,6 +63,7 @@ def strip_empty(myarr):
@rtype: Array
@return: The array with empty elements removed
"""
+
for x in range(len(myarr)-1, -1, -1):
if not myarr[x]:
del myarr[x]