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

#!/usr/bin/env python

# journal.py
#

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

class Journal:
	def __init__(self,chart):
		system = chart.system

		if not system.connected:
			raise ConnectionStatusError

		self.store = system.store

	def details(self,journalid):
		pass

	def balance(self,journalid):
		pass

	def find(self):
		pass


# seperate class to post journals


class JournalPost:
	def __init__(self,chart):
		self.chart = chart

		system = self.chart.system

		if not system.connected:
			raise ConnectionStatusError

		self.store = system.store

		# FIXME - init any structures needed

	def header(self, explanation):
		pass

	def line(self):
		# FIXME more args needs
		pass

	def review(self):
		# FIXME return array of lines
		pass

	def delline(self):
		pass

	def post(self):
		# check in appropriate state
		pass