X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=db_access.py;h=a4d0e736b910ba9dfcd242a36d35862b1901850d;hb=288ceb69f46d61999156d583a7d99436078c6b29;hp=c62cde950f1867661c94771be2b4510a2d402bc8;hpb=53f1d77f290ed84db4b4436bfd2748d63e0e6892;p=dak.git diff --git a/db_access.py b/db_access.py index c62cde95..a4d0e736 100644 --- a/db_access.py +++ b/db_access.py @@ -1,6 +1,6 @@ # DB access fucntions -# Copyright (C) 2000 James Troup -# $Id: db_access.py,v 1.5 2001-01-10 06:08:03 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: db_access.py,v 1.7 2001-04-03 10:01:27 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ location_id_cache = {}; maintainer_id_cache = {}; source_id_cache = {}; files_id_cache = {}; +maintainer_cache = {} ############################################################################################ @@ -249,3 +250,13 @@ def set_files_id (filename, size, md5sum, location_id): ########################################################################################## +def get_maintainer (maintainer_id): + global maintainer_cache; + + if not maintainer_cache.has_key(maintainer_id): + q = projectB.query("SELECT name FROM maintainer WHERE id = %s" % (maintainer_id)); + maintainer_cache[maintainer_id] = q.getresult()[0][0]; + + return maintainer_cache[maintainer_id]; + +##########################################################################################