diff options
author | 2011-05-06 18:15:24 +0530 | |
---|---|---|
committer | 2011-05-06 18:15:24 +0530 | |
commit | 994b501a913466e8fff523fc9c69ae4dedbcd746 (patch) | |
tree | ddec437c43bc050e00c98e5d50bde7f1400e5da8 | |
parent | Use portage.settings instead of forking to emerge --info (diff) | |
download | gentoostats-994b501a913466e8fff523fc9c69ae4dedbcd746.tar.gz gentoostats-994b501a913466e8fff523fc9c69ae4dedbcd746.tar.bz2 gentoostats-994b501a913466e8fff523fc9c69ae4dedbcd746.zip |
add optional sort param
-rw-r--r-- | 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 class Packages(object): - def getInstalledCPs(self): - installed_cps = sorted(VARDB.cp_all()) + + def getInstalledCPs(self, sort=False): + installed_cps = VARDB.cp_all() + if sort: + return sorted(installed_cps) return installed_cps - def getInstalledCPVs(self): - installed_cpvs = sorted(VARDB.cpv_all()) + def getInstalledCPVs(self,sort=False): + installed_cpvs = VARDB.cpv_all() + if sort: + return installed_cpvs return installed_cpvs |