X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=db_access.py;h=a4d0e736b910ba9dfcd242a36d35862b1901850d;hb=7b229c4db5ae4d45dc08cc94c63460395f8e06f1;hp=741e54b80b0c4aa2575428d36661d4b74cf49f26;hpb=d52ebffcc7af210985d90ffc58e7ecc4141dd8a8;p=dak.git diff --git a/db_access.py b/db_access.py index 741e54b8..a4d0e736 100644 --- a/db_access.py +++ b/db_access.py @@ -1,6 +1,6 @@ # DB access fucntions # Copyright (C) 2000, 2001 James Troup -# $Id: db_access.py,v 1.6 2001-03-02 02:24:33 troup Exp $ +# $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]; + +##########################################################################################