DatabaseSession
index
DatabaseSession.py

# -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Dave Eddy <dave@daveeddy.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.
### END LICENSE

 
Modules
       
cPickle
os
pysqlite2.dbapi2

 
Classes
       
DatabaseSession

 
class DatabaseSession
    A class to access and modify a sqlite database.
 
  Methods defined here:
__init__(self, database)
Initialize the database session and create a `variable` table.
commit(self)
Commits the database.
cursor(self)
Returns a cursor to the database.
table_is_empty(self, table_name)
Returns True if the table is empty.
variable_get(self, var_name, default_value=None)
Retrieve a variable from the database.
variable_set(self, var_name, var_value)
Save a variable in the database.