changeset 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 910942d07574
children 61fc775862f7
files orpg/gametree/nodehandlers/containers.py orpg/gametree/nodehandlers/core.py orpg/gametree/nodehandlers/forms.py orpg/orpg_version.py start_server.py
diffstat 5 files changed, 30 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/gametree/nodehandlers/containers.py	Thu Oct 08 04:14:41 2009 -0500
+++ b/orpg/gametree/nodehandlers/containers.py	Thu Oct 08 09:10:55 2009 -0500
@@ -54,9 +54,7 @@
 
 
     def on_send_to_map(self, evt):
-        child = self.tree.GetFirstChild(self.mytree_node)
-        if child[0].IsOk():
-            self.traverse(child[0], self.check_map_aware, 0, evt)
+        self.traverse(self.mytree_node, self.check_map_aware, evt) 
 
 
     def checkChildToMap(self, obj, evt):
@@ -65,9 +63,7 @@
 
     def checkToMapMenu(self):
         self.mapcheck = False
-        child = self.tree.GetFirstChild(self.mytree_node)
-        if child[0].IsOk():
-            self.traverse(child[0], self.checkChildToMap, 0, self.mapcheck)
+        self.traverse(self.mytree_node, self.checkChildToMap)
 
         return self.mapcheck
 
@@ -93,8 +89,7 @@
         self.html_str += "</td></tr>\n"
         self.html_str += "<tr><td>"
 
-        child = self.tree.GetFirstChild(self.mytree_node)
-        self.traverse(child[0], self.gen_html, 0, None)
+        self.traverse(self.mytree_node, self.gen_html, recurse=False)
 
         self.html_str += "</td></tr></table>"
         return self.html_str
@@ -153,9 +148,7 @@
         self.i = 0
         self.tdatas = {}
 
-        child = self.tree.GetFirstChild(self.mytree_node)
-        if child[0].IsOk():
-            self.traverse(child[0], self.gen_html, 0, None)
+        self.traverse(self.mytree_node, self.gen_html, recurse=False)
 
         for td in self.tdatas:
             self.html_str += "<td valign=\"top\" >" + self.tdatas[td] + "</td>\n";
@@ -239,10 +232,7 @@
         orpgTabberWnd.__init__(self, parent, style=FNB.FNB_NO_X_BUTTON)
         self.handler = handler
         self.parent = parent
-        tree = self.handler.tree
-        child = tree.GetFirstChild(handler.mytree_node)
-        if child[0].IsOk():
-            handler.traverse(child[0], self.pick_panel, 0, mode, False)
+        handler.traverse(handler.mytree_node, self.pick_panel, mode, False)
 
         parent.SetSize(self.GetBestSize())
 
@@ -252,7 +242,7 @@
         else:
             panel = obj.get_use_panel(self)
 
-        name = obj.master_dom.getAttribute("name")
+        name = obj.master_dom.getAttribute("name");print 'here '+name
 
         if panel:
             self.AddPage(panel, name, False)
@@ -305,10 +295,7 @@
         self.bestSizex = -1
         self.bestSizey = -1
 
-        cookie = 0
-        (child, cookie) = self.tree.GetFirstChild(self.mytree_node)
-        if child.IsOk():
-            self.traverse(child, self.doSplit, 0, mode, False)
+        self.traverse(self.mytree_node, self.doSplit, mode, False) 
 
         self.pane.sizer.Add(self.splitter, 1, wx.EXPAND)
 
--- a/orpg/gametree/nodehandlers/core.py	Thu Oct 08 04:14:41 2009 -0500
+++ b/orpg/gametree/nodehandlers/core.py	Thu Oct 08 09:10:55 2009 -0500
@@ -36,6 +36,7 @@
     import webbrowser
     from orpg.mapper import map
     import os
+    from wx import DisplaySize
 except:
     import wx
 
@@ -75,23 +76,13 @@
     def on_ldclick(self,evt):
         return 0
 
-    def traverse(self, traverseroot, function, cookie=0, event=None, recursive=True):
-        """ walk tree control """
-        if traverseroot.IsOk():
-            # step in subtree if there are items or ...
-            if self.tree.ItemHasChildren(traverseroot) and recursive:
-                firstchild, cookie = self.tree.GetFirstChild(traverseroot)
-                obj = self.tree.GetPyData(firstchild)
-                function(obj, event)
-                self.traverse(firstchild, function, cookie, event, recursive)
-
-            # ... loop siblings
-            obj = self.tree.GetPyData(traverseroot)
-            function(obj, event)
-
-            child = self.tree.GetNextSibling(traverseroot)
-            if child.IsOk():
-                self.traverse(child, function, cookie, event, recursive)
+    def traverse(self, root, function, data=None, recurse=True):
+        child, cookie = self.tree.GetFirstChild(root)
+        while child.IsOk(): 
+            function(self.tree.GetPyData(child), data) 
+            if recurse: 
+                self.traverse(child, function, data) 
+            child, cookie = self.tree.GetNextChild(root, cookie) 
 
 
     def usefulness(self,text):
@@ -267,7 +258,7 @@
     def on_save(self,evt):
         f = wx.FileDialog(self.tree,"Select a file", dir_struct["user"],"","XML files (*.xml)|*.xml",wx.SAVE)
         if f.ShowModal() == wx.ID_OK:
-            type = f.GetFilterIndex()
+            type = f.GetFilterIndex()
             if f.GetPath()[:len(f.GetPath())-4] != '.xml': file = open(f.GetPath()+'.xml',"w")
             else: file = open(f.GetPath(),"w")
             file.write(self.toxml(1))
@@ -283,7 +274,7 @@
     def get_html_panel(self,parent):
         html_str = "<html><body bgcolor=\"#FFFFFF\" >"+self.tohtml()+"</body></html>"
         wnd = wx.html.HtmlWindow(parent,-1)
-        html_str = self.chat.ParseDice(html_str)
+        html_str = self.chat.ParseDice(html_str)
 	wnd.SetPage(html_str)
         return wnd
 
@@ -455,4 +446,4 @@
 
     def on_ldclick(self,evt):
         self.map.new_data(toxml(self.mapdata))
-        return 1
+        return 1
--- a/orpg/gametree/nodehandlers/forms.py	Thu Oct 08 04:14:41 2009 -0500
+++ b/orpg/gametree/nodehandlers/forms.py	Thu Oct 08 09:10:55 2009 -0500
@@ -28,8 +28,8 @@
 
 __version__ = "$Id: forms.py,v 1.53 2007/04/21 23:00:51 digitalxero Exp $"
 
-from containers import *
-import orpg.minidom as minidom
+from containers import *
+import orpg.minidom as minidom
 from orpg.orpg_xml import xml
 from wx.lib.scrolledpanel import ScrolledPanel
 
@@ -88,16 +88,13 @@
         ScrolledPanel.__init__(self, parent, wx.ID_ANY, style=wx.NO_BORDER|wx.VSCROLL|wx.HSCROLL)
         self.height = int(handler.atts.getAttribute("height"))
         self.width = int(handler.atts.getAttribute("width"))
-
-
+        
         self.SetSize((0,0))
         self.handler = handler
         self.parent = parent
         self.main_sizer = wx.BoxSizer(wx.VERTICAL)
         tree = self.handler.tree
-        child = tree.GetFirstChild(handler.mytree_node)
-        if child[0].IsOk():
-            handler.traverse(child[0], self.create_child_wnd, 0, None, False)
+        handler.traverse(handler.mytree_node, self.create_child_wnd, None, False)
 
         self.SetSizer(self.main_sizer)
         self.SetAutoLayout(True)
@@ -211,7 +208,7 @@
         </nodehandler>
     """
     def __init__(self,xml_dom,tree_node):
-        node_handler.__init__(self,xml_dom,tree_node)
+        node_handler.__init__(self,xml_dom,tree_node)
         self.text_elem = self.master_dom.getElementsByTagName('text')[0]
         self.text = component.get('xml').safe_get_text_node(self.text_elem)
         if self.text_elem.getAttribute("send_button") == "":
@@ -412,7 +409,7 @@
     def __init__(self,xml_dom,tree_node):
         node_handler.__init__(self,xml_dom,tree_node)
         self.list = self.master_dom.getElementsByTagName('list')[0]
-        self.options = self.list.getElementsByTagName('option')
+        self.options = self.list.getElementsByTagName('option')
         if self.list.getAttribute("send_button") == "":
             self.list.setAttribute("send_button","0")
         if self.list.getAttribute("hide_title") == "":
--- a/orpg/orpg_version.py	Thu Oct 08 04:14:41 2009 -0500
+++ b/orpg/orpg_version.py	Thu Oct 08 09:10:55 2009 -0500
@@ -4,7 +4,7 @@
 #BUILD NUMBER FORMAT: "YYMMDD-##" where ## is the incremental daily build index (if needed)
 DISTRO = "Traipse Alpha"
 DIS_VER = "Ornery Orc"
-BUILD = "091008-00"
+BUILD = "091008-01"
 
 # This version is for network capability.
 PROTOCOL_VERSION = "1.2"
--- a/start_server.py	Thu Oct 08 04:14:41 2009 -0500
+++ b/start_server.py	Thu Oct 08 09:10:55 2009 -0500
@@ -7,6 +7,7 @@
 import getopt
 import traceback
 
+
 # Simple usuage text for request via help or command line errors
 def usage( retValue ):
     print "\nUsage: \n[-d --directory directory] - Directory of where to load config files\n" + \
@@ -21,13 +22,6 @@
     "will be prompted for information.\n\n"
     sys.exit( retValue )
 
-HG = os.environ["HG"]
-
-import pyver
-pyver.checkPyVersion()
-
-os.system(HG + ' pull "http://hg.assembla.com/traipse"')
-os.system(HG + ' update')
 
 import orpg.networking.mplay_server
 import orpg.networking.meta_server_lib
@@ -39,8 +33,8 @@
     orpg_server = orpg.networking.mplay_server.mplay_server()
     lobby_boot_pwd = orpg_server.boot_pwd
     server_directory = orpg_server.userPath
-    server_reg = orpg_server.reg
-    server_name = orpg_server.name
+    server_reg = orpg_server.be_registered
+    server_name = orpg_server.serverName
     manualStart = False
 
     # See if we have command line arguments in need of processing
@@ -75,8 +69,8 @@
 
 
     # start server!
-    orpg_server.name = server_name
-    orpg_server.reg = server_reg
+    orpg_server.serverName = server_name
+    orpg_server.be_registered = server_reg
     orpg_server.boot_pwd = lobby_boot_pwd
     orpg_server.userPath = server_directory
     orpg_server.remoteadmin = 1