Gentoo Archives: gentoo-commits

From: Vikraman Choudhury <vikraman.choudhury@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoostats:master commit in: client/
Date: Fri, 06 May 2011 12:45:52
Message-Id: 994b501a913466e8fff523fc9c69ae4dedbcd746.vikraman@gentoo
1 commit: 994b501a913466e8fff523fc9c69ae4dedbcd746
2 Author: Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
3 AuthorDate: Fri May 6 12:45:24 2011 +0000
4 Commit: Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
5 CommitDate: Fri May 6 12:45:24 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=994b501a
7
8 add optional sort param
9
10 ---
11 client/packages.py | 13 +++++++++----
12 1 files changed, 9 insertions(+), 4 deletions(-)
13
14 diff --git a/client/packages.py b/client/packages.py
15 index 4e2bdcd..73cdfc5 100644
16 --- a/client/packages.py
17 +++ b/client/packages.py
18 @@ -3,10 +3,15 @@ import logging
19 from dbapi import VARDB
20
21 class Packages(object):
22 - def getInstalledCPs(self):
23 - installed_cps = sorted(VARDB.cp_all())
24 +
25 + def getInstalledCPs(self, sort=False):
26 + installed_cps = VARDB.cp_all()
27 + if sort:
28 + return sorted(installed_cps)
29 return installed_cps
30
31 - def getInstalledCPVs(self):
32 - installed_cpvs = sorted(VARDB.cpv_all())
33 + def getInstalledCPVs(self,sort=False):
34 + installed_cpvs = VARDB.cpv_all()
35 + if sort:
36 + return installed_cpvs
37 return installed_cpvs