[yum-commits] Branch 'yum-3_2_X' - yum/pkgtag_db.py
James Antill
james at osuosl.org
Tue Jan 11 06:15:59 UTC 2011
yum/pkgtag_db.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 3ee25a9b44fd15faebdf5508c97c9586ae7052cc
Author: James Antill <james at and.org>
Date: Mon Jan 10 17:03:22 2011 -0500
Fix .count (atm. it's an sqlite obj.), don't even run the SQL it's needed.
diff --git a/yum/pkgtag_db.py b/yum/pkgtag_db.py
index 016dd41..afcc28d 100644
--- a/yum/pkgtag_db.py
+++ b/yum/pkgtag_db.py
@@ -53,8 +53,14 @@ class PackageTagDB(object):
# open it and leave a cursor in place for the db
self._conn = sqlite.connect(sqlite_file)
self.cur = self._conn.cursor()
- self.count = self._sql_exec("select count(*) from packagetags",)
-
+
+ def _getTagsCount(self):
+ ''' Unused, so no need to cache. '''
+ for n in self._sql_exec("select count(*) from packagetags",):
+ return n[0]
+
+ count = property(fget=lambda self: self._getTagsCount(),
+ doc="Number of entries in the pkgtag DB")
@catchSqliteException
def _sql_exec(self, sql, *args):
More information about the Yum-commits
mailing list