From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QIKPo-0005JY-Iq for garchives@archives.gentoo.org; Fri, 06 May 2011 12:45:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5D1A71C036; Fri, 6 May 2011 12:45:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 291A61C036 for ; Fri, 6 May 2011 12:45:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6B8F71B4042 for ; Fri, 6 May 2011 12:45:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7B1A180505 for ; Fri, 6 May 2011 12:45:42 +0000 (UTC) From: "Vikraman Choudhury" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Vikraman Choudhury" Message-ID: <994b501a913466e8fff523fc9c69ae4dedbcd746.vikraman@gentoo> Subject: [gentoo-commits] proj/gentoostats:master commit in: client/ X-VCS-Repository: proj/gentoostats X-VCS-Files: client/packages.py X-VCS-Directories: client/ X-VCS-Committer: vikraman X-VCS-Committer-Name: Vikraman Choudhury X-VCS-Revision: 994b501a913466e8fff523fc9c69ae4dedbcd746 Date: Fri, 6 May 2011 12:45:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 8b97acaef7acbfe4ac5abbef6b4f7eb4 commit: 994b501a913466e8fff523fc9c69ae4dedbcd746 Author: Vikraman Choudhury gmail com> AuthorDate: Fri May 6 12:45:24 2011 +0000 Commit: Vikraman Choudhury gmail com> CommitDate: Fri May 6 12:45:24 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoostats.g= it;a=3Dcommit;h=3D994b501a add optional sort param --- client/packages.py | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/packages.py b/client/packages.py index 4e2bdcd..73cdfc5 100644 --- a/client/packages.py +++ b/client/packages.py @@ -3,10 +3,15 @@ import logging from dbapi import VARDB =20 class Packages(object): - def getInstalledCPs(self): - installed_cps =3D sorted(VARDB.cp_all()) + + def getInstalledCPs(self, sort=3DFalse): + installed_cps =3D VARDB.cp_all() + if sort: + return sorted(installed_cps) return installed_cps =20 - def getInstalledCPVs(self): - installed_cpvs =3D sorted(VARDB.cpv_all()) + def getInstalledCPVs(self,sort=3DFalse): + installed_cpvs =3D VARDB.cpv_all() + if sort: + return installed_cpvs return installed_cpvs