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 def details(self, ledgerid): db = self.store.db cursor = db.cursor() cursor.execute(chart_sql['ledgerdetails'] % (ledgerid,)) return cursor.fetchone() def list(self): db = self.store.db cursor = db.cursor() list = [] for row in cursor.execute(chart_sql['ledgerlist']): list.append(row[0]) return list