[SCM] Installer for game data files branch, yaml, updated. 20ed34dd0bd423016cacc18bd442461cc02165a1

Jon Dowland jmtd at debian.org
Thu Sep 24 17:53:04 UTC 2009


The following commit has been merged in the yaml branch:
commit 225a9215e2f19c29d558b88f1fb682758edf8ce3
Author: Jon Dowland <jmtd at debian.org>
Date:   Thu Sep 24 18:44:14 2009 +0100

    get next action needed

diff --git a/gdp.py b/gdp.py
index 48c0794..6981c69 100755
--- a/gdp.py
+++ b/gdp.py
@@ -26,6 +26,15 @@ class Controller:
 	def set_game(self, game):
 		self.m.set_active_item(game)
 
+	def get_next_action(self):
+		"""return the next action required for the selected game.
+		   currently we do not handle dependencies: the actions will
+		   need to be specified in the precise order they are required
+		   to be satisfied."""
+		actions = self.m[self.m.active_item]['actions']
+		actions = filter(lambda x: not x.has_key('complete'), actions)
+		return actions[0]
+
 	def go(self):
 			self.view.go()
 
@@ -69,9 +78,16 @@ class View:
 
 	def forward_page_func(self, current_page, data):
 		if 0 == current_page:
+			# XXX: bug. active row not reported properly if keyboard nav used
 			treeview = self.builder.get_object("treeview1")
 			path,col = treeview.get_cursor()
 			self.controller.set_game(path[0])
+		na = self.controller.get_next_action()
+		if na.has_key('type') and "copy" == na['type']:
+			# TODO: setup the next page, a file copy page.
+			print na
+		else: # XXX: validation should live elsewhere
+			print "not a recognised action type :("
 		return current_page + 1
 
 	def setup_filechooser_page(self):

-- 
Installer for game data files



More information about the Pkg-games-commits mailing list