comparison orpg/gametree/nodehandlers/core.py @ 111:0c936d98f9eb alpha

Traipse Alpha 'OpenRPG' {091008-01} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: {091006} 00: Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images! 03: Changes made to the map for increased portability. SnowDog has changes planned in Core, though. Added an initial push to the BCG. Not much to see, just shows off how it is re-writing Main code. {091007} 00: New images added to Plugin Control Panel for Auto Start. 01: Attempting to fix Deprecation warning from Main. 02: Second attempt, problem in gsclient with "s. 03: Fail. {091008} 00: Fix to remote admin commands 01: Minor fix to texted based server, works in /System/ folder Some Core changes to gametree to correctly disply Pretty Print, thanks David!
author sirebral
date Thu, 08 Oct 2009 09:10:55 -0500
parents 449a8900f9ac
children 217fb049bd00
comparison
equal deleted inserted replaced
110:910942d07574 111:0c936d98f9eb
34 from orpg.dirpath import dir_struct 34 from orpg.dirpath import dir_struct
35 from orpg.orpgCore import component 35 from orpg.orpgCore import component
36 import webbrowser 36 import webbrowser
37 from orpg.mapper import map 37 from orpg.mapper import map
38 import os 38 import os
39 from wx import DisplaySize
39 except: 40 except:
40 import wx 41 import wx
41 42
42 43
43 #html defaults 44 #html defaults
73 self.tree.do_std_menu(evt,self) 74 self.tree.do_std_menu(evt,self)
74 75
75 def on_ldclick(self,evt): 76 def on_ldclick(self,evt):
76 return 0 77 return 0
77 78
78 def traverse(self, traverseroot, function, cookie=0, event=None, recursive=True): 79 def traverse(self, root, function, data=None, recurse=True):
79 """ walk tree control """ 80 child, cookie = self.tree.GetFirstChild(root)
80 if traverseroot.IsOk(): 81 while child.IsOk():
81 # step in subtree if there are items or ... 82 function(self.tree.GetPyData(child), data)
82 if self.tree.ItemHasChildren(traverseroot) and recursive: 83 if recurse:
83 firstchild, cookie = self.tree.GetFirstChild(traverseroot) 84 self.traverse(child, function, data)
84 obj = self.tree.GetPyData(firstchild) 85 child, cookie = self.tree.GetNextChild(root, cookie)
85 function(obj, event)
86 self.traverse(firstchild, function, cookie, event, recursive)
87
88 # ... loop siblings
89 obj = self.tree.GetPyData(traverseroot)
90 function(obj, event)
91
92 child = self.tree.GetNextSibling(traverseroot)
93 if child.IsOk():
94 self.traverse(child, function, cookie, event, recursive)
95 86
96 87
97 def usefulness(self,text): 88 def usefulness(self,text):
98 if text=="useful": 89 if text=="useful":
99 self.master_dom.setAttribute('status',"useful") 90 self.master_dom.setAttribute('status',"useful")