1 """
   2 SQLClose.py -- Copyright 2004 William Waites
   3 
   4 This program is Free Software and is released
   5 under the terms of the GNU General Public License.
   6 Please see http://www.gnu.org/licenses/gpl for
   7 the full text of the terms and conditions.
   8 
   9 Please see the accompanying
  10 SQLConnect macro for documentation
  11 """
  12 
  13 def execute(macro, args):
  14 
  15     if hasattr(macro.request, "sql_cursor") and macro.request.sql_cursor:
  16         macro.request.sql_cursor.close()
  17         delattr(macro.request, "sql_cursor")
  18     if hasattr(macro.request, "sql_db") and macro.request.sql_db:
  19         macro.request.sql_db.close()
  20         delattr(macro.request, "sql_db")

MoinMoin: macro/SQLClose.py (last edited 2007-10-29 19:09:37 by localhost)