Below is the file 'Chart.py' from this revision. You can also download the file.

#!/usr/bin/env python

# chart.py
#

from sqlite3 import dbapi2 as sqlite
from SQLTemplates import *
from Error import *

class Chart:
	def __init__(self,system):
		if not system.connected:
			raise ConnectionStatusError

		self.store = system.store

	def create(self, details, debitbalance, info):
		db = self.store.db
		cursor = db.cursor()

		cursor.execute(chart_sql['newledger'],(details, debitbalance, info))

		db.commit()

		return cursor.lastrowid