terom@22: # DeGAL - A pretty simple web image gallery terom@22: # Copyright (C) 2007 Tero Marttila terom@22: # http://marttila.de/~terom/degal/ terom@22: # terom@22: # This program is free software; you can redistribute it and/or modify terom@22: # it under the terms of the GNU General Public License as published by terom@22: # the Free Software Foundation; either version 2 of the License, or terom@22: # (at your option) any later version. terom@22: # terom@22: # This program is distributed in the hope that it will be useful, terom@22: # but WITHOUT ANY WARRANTY; without even the implied warranty of terom@22: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terom@22: # GNU General Public License for more details. terom@22: # terom@22: # You should have received a copy of the GNU General Public License terom@22: # along with this program; if not, write to the terom@22: # Free Software Foundation, Inc., terom@22: # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. terom@22: # terom@22: terom@22: import sqlite3 terom@22: terom@22: conn = sqlite3.connect("degal.db") terom@22: terom@22: def execute (expr, *args) : terom@22: c = conn.cursor() terom@22: c.execute(expr, args) terom@22: terom@22: return c terom@22: terom@22: def insert (expr, *args) : terom@22: return execute(expr, *args).rowcount terom@22: terom@22: select = execute terom@22: terom@22: cursor = conn.cursor terom@22: