[SCM] Installer for game data files branch, yaml, updated. 4701efc823a748be1713a7c5eb2aa0de6c6c138a

Jon Dowland jmtd at debian.org
Wed Sep 23 14:13:02 UTC 2009


The following commit has been merged in the yaml branch:
commit 4701efc823a748be1713a7c5eb2aa0de6c6c138a
Author: Jon Dowland <jmtd at debian.org>
Date:   Wed Sep 23 15:12:58 2009 +0100

    load up supported/*yaml as model entries

diff --git a/gdp.py b/gdp.py
index 9a75399..59f55e7 100644
--- a/gdp.py
+++ b/gdp.py
@@ -1,16 +1,20 @@
 import os
+import yaml
 
 class Controller:
 	def __init__(self):
 		pass
 	def add_view(self,v):
 		self.view = v
-	def find_supported_games(self):
+	def get_model(self):
+		m = []
 		for game in [ x for x in os.listdir("supported") \
 			if len(x) >= 5 and x[-5:] == ".yaml"]:
-				self.view.supported_game_added(game)
+				y = yaml.load(open("supported/%s"%game,"r").read())
+				m.append(y)
+				self.view.supported_game_added(y)
+		return m
 	def go(self):
-			self.find_supported_games()
 			self.view.go()
 
 import sys
@@ -43,7 +47,7 @@ class View:
 	def supported_game_added(self,game):
 		treeview = self.builder.get_object("treeview1")
 		liststor = self.builder.get_object("liststore1")
-		liststor.append([game])
+		liststor.append([game['longname']])
 	def go(self):
 		self.window.show()
 		gtk.main()
@@ -52,4 +56,5 @@ if __name__ == "__main__":
 	c = Controller()
 	v = View(c)
 	c.add_view(v)
+	m = c.get_model()
 	c.go()

-- 
Installer for game data files



More information about the Pkg-games-commits mailing list