X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=db_access.py;h=d886a2d841080fba93f93601d131c6eaeb9cdc05;hb=2286ce0734fe5dadf2b601165f56d2ebb5a91a5a;hp=64113baaa31ddcdac5c298742c74d4740be15e1b;hpb=d6252d1241c638c36ea7789f6bc85edc90baba41;p=dak.git diff --git a/db_access.py b/db_access.py index 64113baa..d886a2d8 100644 --- a/db_access.py +++ b/db_access.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # DB access fucntions -# Copyright (C) 2000, 2001, 2002, 2003 James Troup -# $Id: db_access.py,v 1.15 2003-02-11 18:09:59 troup Exp $ +# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup +# $Id: db_access.py,v 1.16 2004-06-17 15:00:41 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 @@ -20,7 +20,7 @@ ################################################################################ -import sys, time; +import sys, time, types; ################################################################################ @@ -56,6 +56,12 @@ def do_query(q): r = projectB.query(q); time_diff = time.time()-before; sys.stderr.write("took %.3f seconds.\n" % (time_diff)); + if type(r) is int: + sys.stderr.write("int result: %s\n" % (r)); + elif type(r) is types.NoneType: + sys.stderr.write("result: None\n"); + else: + sys.stderr.write("pgresult: %s\n" % (r.getresult())); return r; ################################################################################