logger = logging.getLogger(__name__)
# Connect to database
+logger.debug("Opening database file blocks.db ...")
connection = sqlite3.connect("blocks.db")
+
+# Attach trace function
+#connection.set_trace_callback(print)
+
+# Init row factory
+logger.debug("connection='%s' - setting row factory ...", connection)
+connection.row_factory = sqlite3.Row
+
+# Get cursor
cursor = connection.cursor()