#format python """ SQLClose.py -- Copyright 2004 William Waites This program is Free Software and is released under the terms of the GNU General Public License. Please see http://www.gnu.org/licenses/gpl for the full text of the terms and conditions. Please see the accompanying SQLConnect macro for documentation """ def execute(macro, args): if hasattr(macro.request, "sql_cursor") and macro.request.sql_cursor: macro.request.sql_cursor.close() delattr(macro.request, "sql_cursor") if hasattr(macro.request, "sql_db") and macro.request.sql_db: macro.request.sql_db.close() delattr(macro.request, "sql_db")