The unified diff between revisions [46260d8c..] and [a989bc32..] is displayed below. It can also be downloaded as a raw diff.

#
#
# patch "Store.py"
#  from [f11ecd9c7fdce9398cceaac8572bc9674fcc7925]
#    to [a699d9475316ba2c3199c72f949eaeb793d9c69e]
#
# patch "System.py"
#  from [b9e8846a7652c079d9ec8412b09e1510d9019c35]
#    to [0f32fcc7f8fae4c86d49041278eaaad41a8c92c4]
#
# patch "SystemInterface.py"
#  from [1e554f35a84a6a7347f7e4922e9cdf58a49b0545]
#    to [4f706c76bc1d6898047e3f6db69ebfe24e7f34a5]
#
============================================================
--- Store.py	f11ecd9c7fdce9398cceaac8572bc9674fcc7925
+++ Store.py	a699d9475316ba2c3199c72f949eaeb793d9c69e
@@ -31,6 +31,8 @@ class Store:
 		if not self.check_schema():
 			raise CreateError

+		return True
+
 	def connect(self,file):
 		print file
 		self.db = sqlite.connect(file)
@@ -38,6 +40,8 @@ class Store:

 		if not self.check_schema():
 			raise ConnectError, "Schema not matching"
+
+		return True

 	def check_schema(self):
 		for statement in create_fourstar_db.keys():
============================================================
--- System.py	b9e8846a7652c079d9ec8412b09e1510d9019c35
+++ System.py	0f32fcc7f8fae4c86d49041278eaaad41a8c92c4
@@ -61,7 +61,7 @@ class System:

 		self.store = Store()

-		self.store.connect(filename)
+		self.connected = self.store.connect(filename)

 	def create_store(self,filename):
 		# need to check file does not exists
@@ -72,4 +72,4 @@ class System:

 		self.store = Store()

+		self.connected = self.store.create(filename)
-		self.store.create(filename)
============================================================
--- SystemInterface.py	1e554f35a84a6a7347f7e4922e9cdf58a49b0545
+++ SystemInterface.py	4f706c76bc1d6898047e3f6db69ebfe24e7f34a5
@@ -53,19 +53,28 @@ class SystemInterface:
 			vstatus.change_state(STATE_STATUS, 1)
 			return

-		# FIXME restrict this mode if db not created/connected
+		# restrict this mode if db not created/connected
 		if len(args) >= 1 and args[0] == "chart":
-			vstatus.change_state(STATE_CHART_IDLE, 1)
+			if v.connected:
+				vstatus.change_state(STATE_CHART_IDLE, 1)
+			else:
+				print "not connected"
 			return

-		# FIXME restrict this mode if db not created/connected
+		# restrict this mode if db not created/connected
 		if len(args) >= 1 and args[0] == "ledger":
-			vstatus.change_state(STATE_LEDGER_IDLE, 1)
+			if v.connected:
+				vstatus.change_state(STATE_LEDGER_IDLE, 1)
+			else:
+				print "not connected"
 			return

-		# FIXME restrict this mode if db not created/connected
+		# restrict this mode if db not created/connected
 		if len(args) >= 1 and args[0] == "journal":
-			vstatus.change_state(STATE_JOURNAL_IDLE, 1)
+			if v.connected:
+				vstatus.change_state(STATE_JOURNAL_IDLE, 1)
+			else:
+				print "not connected"
 			return

 		print "4 command not understood: %s" % (self.input,)