# HG changeset patch
# User sirebral
# Date 1257876673 21600
# Node ID 37d26a98883f51c9447bb86b3f0247eaa09857fb
# Parent fe4dc5817d5ec307c31408c71b804f042ea1a364
Traipse Alpha 'OpenRPG' {091010-00}
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 (Cleaning up for Beta)
Added Bookmarks
Fix to Remote Admin Commands
Minor fix to text based Server
Fix to Pretty Print, from Core
Fix to Splitter Nodes not being created
Fix to massive amounts of images loading, from Core
Added 'boot' command to remote admin
Added confirmation window for sent nodes
Minor changes to allow for portability to an OpenSUSE linux OS
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Zoom Mouse plugin added
Images added to Plugin UI
Switching to Element Tree
Map efficiency, from FlexiRPG
Added Status Bar to Update Manager
default_manifest.xml renamed to default_upmana.xml
Cleaner clode for saved repositories
New TrueDebug Class in orpg_log (See documentation for usage)
Mercurial's hgweb folder is ported to upmana
**Pretty important update that can help remove thousands of dead children from your gametree.
**Children, , , , , , , etc... are all tags now.
Check your gametree and look for dead children!!
**New Gamtree Recusion method, mapping, and context sensitivity. !!Alpha - Watch out for infinite loops!!
Dead Node Children, now that's a
O O
-v-v- Happy Halloween!
diff -r fe4dc5817d5e -r 37d26a98883f orpg/chat/chat_msg.py
--- a/orpg/chat/chat_msg.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/chat/chat_msg.py Tue Nov 10 12:11:13 2009 -0600
@@ -31,8 +31,8 @@
from orpg.orpgCore import *
from chat_version import CHAT_VERSION
-from orpg.tools.orpg_log import logger
-from orpg.tools.decorators import debugging
+from orpg.tools.orpg_log import logger, debug
+from xml.etree.ElementTree import tostring, fromstring
CHAT_MESSAGE = 1
WHISPER_MESSAGE = 2
@@ -42,64 +42,43 @@
WHISPER_EMOTE_MESSAGE = 6
class chat_msg:
- @debugging
- def __init__(self,xml_text=""):
- self.chat_dom = None
+
+ def __init__(self, xml_text=""):
+ self.chat_dom = None
self.takexml(xml_text)
- @debugging
def __del__(self):
if self.chat_dom:
self.chat_dom.unlink()
- @debugging
- def toxml(self):
- return component.get('xml').toxml(self.chat_dom)
+ def toxml(self):
+ return tostring(self.chat_dom)
- @debugging
def takexml(self,xml_text):
- xml_dom = component.get('xml').parseXml(xml_text)
- node_list = xml_dom.getElementsByTagName("chat")
- if len(node_list) < 1:
- print "Warning: no elements found in DOM."
- else:
- if len(node_list) > 1:
- print "Found more than one instance of <" + self.tagname + "/>. Taking first one"
- self.takedom(node_list[0])
-
- @debugging
- def takedom(self,xml_dom):
- if self.chat_dom:
- self.text_node = None
- self.chat_dom.unlink()
- self.chat_dom = xml_dom
- self.text_node = component.get('xml').safe_get_text_node(self.chat_dom)
+ xml_dom = fromstring(xml_text)
+ self.takedom(xml_dom)
- @debugging
- def set_text(self,text):
- text = component.get('xml').strip_text(text)
- self.text_node._set_nodeValue(text)
-
- @debugging
+ def takedom(self, xml_dom):
+ self.chat_dom = xml_dom
+ self.text_node = xml_dom.text
+
+ def set_text(self, text):
+ self.chat_dom.text = text
+
def set_type(self,type):
- self.chat_dom.setAttribute("type",str(type))
-
- @debugging
+ self.chat_dom.set("type", str(type))
+
def get_type(self):
- return int(self.chat_dom.getAttribute("type"))
+ return int(self.chat_dom.get("type"))
- @debugging
def set_alias(self,alias):
- self.chat_dom.setAttribute("alias",alias)
+ self.chat_dom.set("alias",alias)
- @debugging
def get_alias(self):
- return self.chat_dom.getAttribute("alias")
+ return self.chat_dom.get("alias")
- @debugging
def get_text(self):
- return self.text_node._get_nodeValue()
+ return self.text_node
- @debugging
def get_version(self):
- return self.chat_dom.getAttribute("version")
+ return self.chat_dom.get("version")
diff -r fe4dc5817d5e -r 37d26a98883f orpg/chat/chatwnd.py
--- a/orpg/chat/chatwnd.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/chat/chatwnd.py Tue Nov 10 12:11:13 2009 -0600
@@ -42,39 +42,30 @@
##
## Module Loading
-##
+##
+import os, time, re, sys, traceback, webbrowser, commands, chat_msg, chat_util
+
+from orpg.orpg_version import VERSION
from orpg.orpg_windows import *
from orpg.player_list import WG_LIST
from orpg.dirpath import dir_struct
+#from orpg.tools.metamenus import MenuEx #Needed?
+from string import *
+
+import cStringIO # for reading inline imagedata as a stream
+from HTMLParser import HTMLParser
+from wx.lib.expando import EVT_ETC_LAYOUT_NEEDED
+
import orpg.tools.rgbhex
import orpg.tools.inputValidator
-#from orpg.tools.metamenus import MenuEx #Needed?
-
-import webbrowser
-from string import *
-from orpg.orpg_version import VERSION
-import commands
-import chat_msg
-import time
+from orpg.tools.validate import validate
+from orpg.tools.orpg_settings import settings
import orpg.tools.predTextCtrl
+from orpg.tools.orpg_log import logger, debug
+from orpg.orpgCore import component
+from xml.etree.ElementTree import tostring
+
from orpg.networking.mplay_client import MPLAY_CONNECTED # needed to only send typing/not_typing messages while connected
-import os
-import time
-import re
-import sys
-import cStringIO # for reading inline imagedata as a stream
-from HTMLParser import HTMLParser
-import chat_util
-import traceback
-from wx.lib.expando import EVT_ETC_LAYOUT_NEEDED
-
-from orpg.tools.validate import validate
-from orpg.tools.orpg_settings import settings
-from orpg.orpgCore import component
-from orpg.tools.orpg_log import logger, debug
-from orpg.tools.decorators import debugging
-
-from xml.etree.ElementTree import tostring
NEWCHAT = False
try:
@@ -894,8 +885,8 @@
self.build_dice()
self.build_scroll()
self.build_text()
- self.toolbar_sizer.Add( self.textpop_lock, 0, wx.EXPAND )
- self.toolbar_sizer.Add(self.scroll_lock,0,wx.EXPAND)
+ self.toolbar_sizer.Add(self.textpop_lock, 0, wx.EXPAND)
+ self.toolbar_sizer.Add(self.scroll_lock, 0, wx.EXPAND)
self.build_formating()
self.build_colorbutton()
@@ -904,7 +895,8 @@
self.scroll_lock = wx.Button( self, wx.ID_ANY, "Scroll ON",size= wx.Size(80,25))
- def build_alias(self):
+ def build_alias(self):
+ self.aliasSizer = wx.BoxSizer(wx.HORIZONTAL) ## Future ## Add these to a sizer, then turn the toolbar_sizer into a grid so these can adjust to the frame.
self.aliasList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultAliasName])
self.aliasButton = createMaskedButton( self, dir_struct["icon"] + 'player.gif',
'Refresh list of aliases from Game Tree', wx.ID_ANY, '#bdbdbd' )
@@ -912,29 +904,23 @@
self.filterList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultFilterName])
self.filterButton = createMaskedButton( self, dir_struct["icon"] + 'add_filter.gif',
'Refresh list of filters from Game Tree', wx.ID_ANY, '#bdbdbd' )
- self.filterList.SetSelection(0)
- self.toolbar_sizer.Add( self.aliasButton, 0, wx.EXPAND )
- self.toolbar_sizer.Add( self.aliasList,0,wx.EXPAND)
- self.toolbar_sizer.Add( self.filterButton, 0, wx.EXPAND )
- self.toolbar_sizer.Add( self.filterList,0,wx.EXPAND)
+ self.filterList.SetSelection(0)
+
+ self.aliasSizer.Add( self.aliasButton, 0, wx.EXPAND )
+ self.aliasSizer.Add( self.aliasList,0,wx.EXPAND)
+ self.aliasSizer.Add( self.filterButton, 0, wx.EXPAND )
+ self.aliasSizer.Add( self.filterList,0,wx.EXPAND)
+
+ self.toolbar_sizer.Add(self.aliasSizer, 0, wx.EXPAND)
+
if self.settings.get_setting('AliasTool_On') == '0': self.toggle_alias('0')
else: self.toggle_alias('1')
- def toggle_alias(self, act):
- if act == '0':
- self.toolbar_sizer.Show(self.aliasList, False)
- self.toolbar_sizer.Show(self.filterList, False)
- self.toolbar_sizer.Show(self.aliasButton, False)
- self.toolbar_sizer.Show(self.filterButton, False)
- self.toolbar_sizer.Layout()
- else:
- self.toolbar_sizer.Show(self.aliasList, True)
- self.toolbar_sizer.Show(self.filterList, True)
- self.toolbar_sizer.Show(self.aliasButton, True)
- self.toolbar_sizer.Show(self.filterButton, True)
- self.toolbar_sizer.Layout()
-
+ def toggle_alias(self, act):
+ if act == '0': self.toolbar_sizer.Show(self.aliasSizer, False)
+ else: self.toolbar_sizer.Show(self.aliasSizer, True)
+ self.toolbar_sizer.Layout()
def build_text(self):
self.textpop_lock = createMaskedButton(self, dir_struct["icon"]+'note.gif', 'Open Text View Of Chat Session', wx.ID_ANY, '#bdbdbd')
@@ -1184,7 +1170,7 @@
wx.WXK_F11: 'event.GetKeyCode() == wx.WXK_F11', wx.WXK_F12: 'event.GetKeyCode() == wx.WXK_F12'}
bin_event = event.GetKeyCode()
- if recycle_bin.has_key(bin_event):
+ if recycle_bin.has_key(bin_event):
logger.debug(lambda bin_event: recycle_bin[bin_event])
macroText = self.settings.get_setting(recycle_bin[bin_event][29:])
recycle_bin = {}; del bin_event
@@ -1777,7 +1763,7 @@
self.chatwnd.AppendToPage(newline)
self.scroll_down()
else: self.storedata.append(newline)
- if send:
+ if send:
if self.type == MAIN_TAB and self.sendtarget == 'all': self.send_chat_message(s)
elif self.type == MAIN_TAB and self.sendtarget == "gm":
the_gms = self.get_gms()
@@ -1841,7 +1827,6 @@
"""Parses player input for embedded nodes rolls"""
cur_loc = 0
#[a-zA-Z0-9 _\-\.]
- debug(s)
reg = re.compile("(!@(.*?)@!)")
matches = reg.findall(s)
for i in xrange(0,len(matches)):
@@ -1934,22 +1919,18 @@
return rs
def resolve_loop(self, node, path, step, depth):
- debug((node.get('name'), step, depth))
if step == depth:
self.resolution(node)
else:
child_list = node.findall('nodehandler')
- debug(child_list)
for child in child_list:
if step == depth: break
if child.get('name') == path[step]:
- debug(('Step', child.get('name'), step, path, path[step]))
node = child
step += 1
self.resolve_loop(node, path, step, depth)
def resolution(self, node):
- debug((node))
if self.passed == False:
self.passed = True
if node.get('class') == 'textctrl_handler': self.data = str(node.find('text').text)
@@ -1980,7 +1961,6 @@
self.gametree = component.get('tree')
dom = self.gametree.xml_root.getchildren()
for node in dom:
- debug((node.get('name'), path[0]))
if node.get('name') == path[0]:
self.resolve_loop(node, path, 1, len(path))
return self.data
diff -r fe4dc5817d5e -r 37d26a98883f orpg/chat/commands.py
--- a/orpg/chat/commands.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/chat/commands.py Tue Nov 10 12:11:13 2009 -0600
@@ -8,15 +8,13 @@
#
-import string
-import time
+import string, time
import orpg.orpg_version
import orpg.orpg_windows
import traceback
from orpg.orpgCore import component
from orpg.tools.orpg_log import logger
-from orpg.tools.decorators import debugging
##--------------------------------------------------------------
## dynamically loading module for extended developer commands
@@ -40,7 +38,7 @@
#
# !self : instance of self
# !chat : instance of the chat window to write to
- @debugging
+
def __init__(self,chat):
self.post = chat.Post
self.colorize = chat.colorize
@@ -61,7 +59,7 @@
#
# !self : instance of self
# !text : string of text matching an implemented emotion
- @debugging
+
def addcommand(self, cmd, function, helpmsg):
if not self.cmdlist.has_key(cmd) and not self.shortcmdlist.has_key(cmd):
self.cmdlist[cmd] = {}
@@ -69,12 +67,12 @@
self.cmdlist[cmd]['help'] = helpmsg
#print 'Command Added: ' + cmd
- @debugging
+
def addshortcmd(self, shortcmd, longcmd):
if not self.shortcmdlist.has_key(shortcmd) and not self.cmdlist.has_key(shortcmd):
self.shortcmdlist[shortcmd] = longcmd
- @debugging
+
def removecmd(self, cmd):
if self.cmdlist.has_key(cmd):
del self.cmdlist[cmd]
@@ -84,7 +82,7 @@
#print 'Command Removed: ' + cmd
- @debugging
+
def defaultcmds(self):
self.addcommand('/help', self.on_help, '- Displays this help message')
self.addcommand('/version', self.on_version, ' - Displays current version of OpenRPG.')
@@ -114,7 +112,7 @@
self.addcommand('/purge', self.on_purge, 'This will clear the entire chat window')
self.addcommand('/advfilter', self.on_filter, 'This will toggle the Advanced Filter')
- @debugging
+
def defaultcmdalias(self):
self.addshortcmd('/?', '/help')
self.addshortcmd('/he', '/me')
@@ -129,7 +127,7 @@
#This is just an example or a differant way the shorcmd can be used
self.addshortcmd('/sleep', '/me falls asleep')
- @debugging
+
def docmd(self,text):
cmdsearch = string.split(text,None,1)
cmd = string.lower(cmdsearch[0])
@@ -145,7 +143,7 @@
msg = "Sorry I don't know what %s is!" % (cmd)
self.chat.InfoPost(msg)
- @debugging
+
def on_filter(self, cmdargs):
#print self.chat.advancedFilter
test = not self.chat.advancedFilter
@@ -170,12 +168,12 @@
else:
self.chat.InfoPost("Advanced Filtering has been turned Off")
- @debugging
+
def on_purge(self, cmdargs):
self.chat.PurgeChat()
self.chat.InfoPost('Chat Buffer has been Purged!')
- @debugging
+
def on_sound(self, cmdargs):
if len(cmdargs) < 8:
self.chat.InfoPost("You must provide a URL for the file name, it does not work for just local sound files")
@@ -209,11 +207,11 @@
else:
self.chat.InfoPost("Something dun fuckered up Frank!")
- @debugging
+
def on_version(self, cmdargs=""):
self.chat.InfoPost("Version is OpenRPG " + self.chat.version)
- @debugging
+
def on_load(self, cmdargs):
args = string.split(cmdargs,None,-1)
try:
@@ -224,14 +222,14 @@
print e
self.chat.InfoPost("ERROR Loading settings")
- @debugging
+
def on_font(self, cmdargs):
try:
fontsettings = self.chat.set_default_font(fontname=cmdargs, fontsize=None)
except:
self.chat.InfoPost("ERROR setting default font")
- @debugging
+
def on_fontsize(self, cmdargs):
args = string.split(cmdargs,None,-1)
try:
@@ -240,7 +238,7 @@
print e
self.chat.InfoPost("ERROR setting default font size")
- @debugging
+
def on_close(self, cmdargs):
try:
chatpanel = self.chat
@@ -252,7 +250,7 @@
except:
self.chat.InfoPost("Error: cannot close private chat tab.")
- @debugging
+
def on_time(self, cmdargs):
local_time = time.localtime()
gmt_time = time.gmtime()
@@ -260,7 +258,7 @@
self.chat.InfoPost("
Local: " + time.strftime(format_string)+\
"
GMT: "+time.strftime(format_string,gmt_time))
- @debugging
+
def on_dieroller(self, cmdargs):
args = string.split(cmdargs,None,-1)
rm = component.get('DiceManager')
@@ -273,13 +271,13 @@
self.chat.InfoPost("Available die rollers: " + str(rm.listRollers()))
self.chat.InfoPost("You are using the \"" + rm.getRoller() + "\" die roller.")
- @debugging
+
def on_ping(self, cmdargs):
ct = time.clock()
msg = ""
self.session.outbox.put(msg)
- @debugging
+
def on_log(self,cmdargs):
args = string.split(cmdargs,None,-1)
logfile = self.settings.get_setting( 'GameLogPrefix' )
@@ -311,7 +309,7 @@
else:
self.chat.InfoPost("Unknown logging command, use 'on' or 'off'" )
- @debugging
+
def postLoggingState( self ):
logfile = self.settings.get_setting( 'GameLogPrefix' )
try:
@@ -325,7 +323,7 @@
#
#!self : instance of self
- @debugging
+
def on_name(self, cmdargs):
#only 20 chars no more! :)
if cmdargs == "":
@@ -339,7 +337,7 @@
# This subroutine will set the players netork status.
#
# !self : instance of self
- @debugging
+
def on_status(self, cmdargs):
if cmdargs == "":
self.chat.InfoPost("Incorrect synatx for status.")
@@ -349,7 +347,7 @@
self.session.set_text_status(str(txt))
# def on_status - end
- @debugging
+
def on_set(self, cmdargs):
args = string.split(cmdargs,None,-1)
keys = self.settings.get_setting_keys()
@@ -384,7 +382,7 @@
#
#!self : instance of self
- @debugging
+
def on_help(self, cmdargs=""):
cmds = self.cmdlist.keys()
cmds.sort()
@@ -406,7 +404,7 @@
# !self : instance of self
# !text : string that is comprised of a list of users to toggle the ignore flag
- @debugging
+
def on_ignore(self, cmdargs):
args = string.split(cmdargs,None,-1)
(ignore_list, ignore_name) = self.session.get_ignore_list()
@@ -433,7 +431,7 @@
self.chat.InfoPost(m + " was ignored because it is an invalid player ID")
traceback.print_exc()
- @debugging
+
def on_role(self, cmdargs):
if cmdargs == "":
self.session.display_roles()
@@ -464,7 +462,7 @@
# !text : string that is comprised of a list of users and the message to
#whisper.
- @debugging
+
def on_whisper(self, cmdargs):
delim = cmdargs.find("=")
@@ -481,7 +479,7 @@
#---------------------------------------------------------
# [START] Digitalxero Multi Whisper Group 1/1/05
#---------------------------------------------------------
- @debugging
+
def on_groupwhisper(self, cmdargs):
args = string.split(cmdargs,None,-1)
delim = cmdargs.find("=")
@@ -539,7 +537,7 @@
# [END] Digitalxero Multi Whisper Group 1/1/05
#---------------------------------------------------------
- @debugging
+
def on_gmwhisper(self, cmdargs):
if cmdargs == "":
self.chat.InfoPost("**Incorrect syntax for GM Whisper.")
@@ -553,7 +551,7 @@
self.on_whisper(gmstring + "=" + cmdargs)
else: self.chat.InfoPost("**No GMs to Whisper to.")
- @debugging
+
def on_moderate(self, cmdargs):
if cmdargs != "":
pos = cmdargs.find("=")
@@ -586,11 +584,11 @@
self.session.outbox.put(msg)
self.session.update()
- @debugging
+
def on_update(self, cmdargs):
self.chat.InfoPost("This command is no longer valid")
- @debugging
+
def on_description(self, cmdargs):
if len(cmdargs) <= 0:
self.chat.InfoPost("**No description text to display." + str(delim))
@@ -601,7 +599,7 @@
self.chat.Post(mesg)
self.chat.send_chat_message(mesg)
- @debugging
+
def invoke_tab(self, cmdargs):
######START mDuo13's Tab Initiator########
try:
@@ -627,7 +625,7 @@
#######END mDuo13's Tab Initiator#########
- @debugging
+
def on_remote_admin(self, cmdargs):
args = string.split(cmdargs,None,-1)
#handles remote administration commands
@@ -675,7 +673,6 @@
elif len(args) == 2:
admin_command = {'ban': ' cmd="ban" bid="' + str(args[1]) + '" />',
'unban': ' cmd="unban" ip="' + str(args[1]) + '" />',
- 'nameroom': " cmd='nameroom' rmid="+ str(args[1])+" name="+ string.join(args[2:])+" />",
'broadcast': " cmd='broadcast' msg='"+ string.join(args[1:])+"' />",
'killgroup': " cmd='killgroup' gid='"+ str(args[1])+"' />"
}
@@ -684,7 +681,8 @@
self.session.outbox.put(msg)
elif len(args) == 3:
- admin_command = {'message':" cmd='message' to_id='"+ str(args[1])+"' msg='"+ string.join(args[2:])+"' />",
+ admin_command = {'message':" cmd='message' to_id='"+ str(args[1])+"' msg='"+ string.join(args[2:])+"' />",
+ 'nameroom': " cmd='nameroom' rmid='"+ str(args[1])+"' name='"+ string.join(args[2:])+"' />",
'passwd': " cmd='passwd' gid='"+str(args[1])+"' pass='"+ str(args[2])+"' />"
}
if admin_command.has_key(args[0]):
diff -r fe4dc5817d5e -r 37d26a98883f orpg/gametree/gametree.py
--- a/orpg/gametree/gametree.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/gametree/gametree.py Tue Nov 10 12:11:13 2009 -0600
@@ -370,12 +370,7 @@
return ret_string
- def on_receive_data(self, data, player):
- if iselement(data):
- tostring(data)
- beg = string.find(data,"")
- end = string.rfind(data,"")
- data = data[6:end]
+ def on_receive_data(self, data):
self.insert_xml(data)
def on_send_to_chat(self, evt):
@@ -531,8 +526,8 @@
def save_tree(self, filename=dir_struct["user"]+'tree.xml'):
- self.xml_root.set("version",GAMETREE_VERSION)
- settings.change("gametree",filename)
+ self.xml_root.set("version", GAMETREE_VERSION)
+ settings.change("gametree", filename)
ElementTree(self.xml_root).write(filename)
@@ -634,13 +629,11 @@
about = MyAboutBox(self,obj.about())
about.ShowModal()
about.Destroy()
-
def on_send_to_map(self, evt):
item = self.GetSelection()
obj = self.GetPyData(item)
if hasattr(obj,"on_send_to_map"): obj.on_send_to_map(evt)
-
def insert_xml(self, txt):
#Updated to allow safe merging of gametree files
@@ -654,16 +647,21 @@
except ExpatError:
wx.MessageBox("Error Importing Node or Tree")
logger.general("Error Importing Node or Tree")
- return
+ return
if new_xml.tag == "gametree":
for xml_child in new_xml:
self.load_xml(xml_child, self.root)
return
+
+ if new_xml.tag == "tree":
+ self.xml_root.append(new_xml.find('nodehandler'))
+ for xml_child in new_xml:
+ self.load_xml(xml_child, self.root)
+ return
self.xml_root.append(new_xml)
self.load_xml(new_xml, self.root, self.root)
-
def build_img_list(self):
"""make image list"""
@@ -688,9 +686,9 @@
family_tree.append(parent)
return family_tree
- def load_xml(self, xml_element, parent_node, prev_node=None):
+ def load_xml(self, xml_element, parent_node, prev_node=None):
if parent_node != self.root:
- ## Loading XML seems to lag on Grids ##
+ ## Loading XML seems to lag on Grids and Images need a cache for load speed ##
family_tree = self.get_tree_map(parent_node)
family_tree.reverse()
map_str = '' #'!@'
@@ -727,12 +725,10 @@
self.id = self.id + 1
except Exception, er:
logger.exception(traceback.format_exc())
-
# was deleted -- should we delete non-nodehandler nodes then?
#self.Delete(new_tree_node)
#parent = xml_dom._get_parentNode()
#parent.removeChild(xml_dom)
-
return new_tree_node
def cached_load_of_image(self, bmp_in, new_tree_node):
@@ -760,7 +756,6 @@
if(isinstance(obj,core.node_handler)): obj.on_rclick(evt)
else: self.PopupMenu(self.top_menu)
else: self.PopupMenu(self.top_menu,pt)
-
def on_ldclick(self, evt):
self.rename_flag = 0
@@ -776,7 +771,6 @@
elif action == "design": obj.on_design(evt)
elif action == "print": obj.on_html_view(evt)
elif action == "chat": self.on_send_to_chat(evt)
-
def on_left_down(self, evt):
pt = evt.GetPosition()
@@ -790,7 +784,6 @@
self.rename_flag = 1
else: self.SelectItem(item)
evt.Skip()
-
def on_left_up(self, evt):
if self.dragging:
@@ -813,7 +806,6 @@
if recurse:
self.traverse(child, function, data)
child, cookie = self.GetNextChild(root, cookie)
-
def on_label_change(self, evt):
item = evt.GetItem()
@@ -824,7 +816,6 @@
obj = self.GetPyData(item)
obj.xml_root.setAttribute('name',txt)
else: evt.Veto()
-
def on_label_begin(self, evt):
if not self.rename_flag: evt.Veto()
@@ -833,7 +824,6 @@
item = evt.GetItem()
if item == self.GetRootItem():
evt.Veto()
-
def on_drag(self, evt):
self.rename_flag = 0
@@ -845,7 +835,6 @@
cur = wx.StockCursor(wx.CURSOR_HAND)
self.SetCursor(cur)
self.drag_obj = obj
-
def is_parent_node(self, node, compare_node):
parent_node = self.GetItemParent(node)
diff -r fe4dc5817d5e -r 37d26a98883f orpg/main.py
--- a/orpg/main.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/main.py Tue Nov 10 12:11:13 2009 -0600
@@ -35,7 +35,7 @@
from orpg.orpg_windows import *
import wx.py
-#from orpg import minidom
+
import orpg.player_list
import orpg.tools.pluginui as pluginUI
import orpg.tools.aliaslib
@@ -55,7 +55,7 @@
from orpg.dirpath import dir_struct
from orpg.dieroller.utils import DiceManager
-from orpg.tools.orpg_settings import settings
+from orpg.tools.settings import settings
from orpg.tools.validate import validate
from orpg.tools.passtool import PassTool
from orpg.tools.orpg_log import logger, crash, debug
@@ -63,6 +63,9 @@
from xml.etree.ElementTree import ElementTree, Element, parse
from xml.etree.ElementTree import fromstring, tostring
+## Element Tree usage will require users to convert to and from string data quite often until users of older versions update.
+## This is a problem that users of older versions will need to cross as it is both Core and Traipse that will make the change.
+## Older versions have a problem with correct XML.
from orpg.orpg_xml import xml #to be replaced by etree
@@ -237,6 +240,7 @@
if settings.get('Heartbeat') == '1':
self.mainmenu.SetMenuState("GameServerServerHeartbeat", True)
+ self.mainmenu.SetMenuState('ToolsPasswordManager', True if settings.get('PWMannager') == 'On' else False)
tabtheme = settings.get('TabTheme') #This change is stable. TaS.
self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful')
self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw')
@@ -264,7 +268,7 @@
self.traipseSuite = wx.Menu()
self.mainmenu.Insert(5, self.traipseSuite, "&Traipse Suite")
- #Update Manager
+ #Update Manager
mana = wx.MenuItem(self.traipseSuite, wx.ID_ANY, "Update Manager", "Update Manager")
self.Bind(wx.EVT_MENU, self.OnMB_UpdateManagerPanel, mana)
self.traipseSuite.AppendItem(mana)
@@ -742,10 +746,9 @@
logger.debug("AUI Bindings Done")
#Load the layout if one exists
- layout = xml_dom.findall("DockLayout")
+ layout = xml_dom.find("DockLayout")
try:
- textnode = xml.safe_get_text_node(layout[0])
- self._mgr.LoadPerspective(textnode.text)
+ self._mgr.LoadPerspective(layout.text)
except: pass
logger.debug("Perspective Loaded")
self._mgr.GetPane("Browse Server Window").Hide()
@@ -866,7 +869,7 @@
def saveLayout(self):
filename = dir_struct["user"] + "layout.xml"
- layout = parse(dir_struct["user"] + "layout.xml")
+ layout = parse(filename)
xml_dom = layout.getroot()
(x_size,y_size) = self.GetClientSize()
(x_pos,y_pos) = self.GetPositionTuple()
@@ -877,17 +880,19 @@
xml_dom.set("posx", str(x_pos))
xml_dom.set("posy", str(y_pos))
xml_dom.set("maximized", str(max))
- layout = xml_dom.findall("DockLayout")
try:
- layout[0].text = str(self._mgr.SavePerspective())
+ xml_dom.find("DockLayout").text = str(self._mgr.SavePerspective())
except:
elem = Element('DockLayout')
elem.set("DO_NO_EDIT","True")
elem.text = str(self._mgr.SavePerspective())
xml_dom.append(elem)
+
+ layout.write(filename)
+ """
temp_file = open(filename, "w")
temp_file.write(tostring(xml_dom))
- temp_file.close()
+ temp_file.close()"""
def build_hotkeys(self):
@@ -956,47 +961,33 @@
# ok we are not ignoring this message
#recvSound = "RecvSound" # this will be the default sound. Whisper will change this below
+
### Alpha ###
etreeEl = Element('msg')
try: etreeEl.append(fromstring(data))
except: etreeEl.text = data
### Remove after Element Tree is integrated further ###
- if player:
- display_name = self.chat.chat_display_name(player)
- else:
- display_name = "Server Administrator"
+ if player: display_name = self.chat.chat_display_name(player)
+ else: display_name = "Server Administrator"
- if etreeEl.text:
- self.chat.Post(etreeEl.text)
+ if etreeEl.text: self.chat.Post(etreeEl.text)
for child in etreeEl.getchildren():
if child.tag == 'tree':
### Alpha ### Allows users to decide if they want the node or not.
- dlg = wx.MessageDialog(None, display_name + 'is trying to send you a tree node. Accept?', 'Question',
+ dlg = wx.MessageDialog(None, display_name + ' is trying to send you a tree node. Accept?', 'Question',
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
if dlg.ShowModal() == wx.ID_YES:
dlg.Destroy()
- self.tree.on_receive_data(data, player)
+ debug(child)
+ self.tree.on_receive_data(tostring(child)) #Removed player object because it was unused.
self.chat.InfoPost(display_name + " has sent you a tree node...")
- ### Core ### to be milked in later.
- #TODO: Fix game tree to accepts elements
- #self.tree.on_receive_data(child, player)
- #self.chat.InfoPost(display_name + " has sent you a tree node...")
-
elif child.tag == 'map':
- ### Core ### Adapted from, remove tostring later
#TODO: Fix map to accepts elements
self.map.new_data(tostring(child))
-
elif child.tag == 'chat':
- msg = orpg.chat.chat_msg.chat_msg(data)
+ msg = orpg.chat.chat_msg.chat_msg(tostring(child))
self.chat.post_incoming_msg(msg, player)
- ### Core ### to be milked in later
- #msg = orpg.chat.chat_msg.chat_msg()
- #msg.takedom(child)
- #self.chat.post_incoming_msg(msg, player)
-
-
def on_mplay_event(self, evt):
id = evt.get_id()
diff -r fe4dc5817d5e -r 37d26a98883f orpg/mapper/images.py
--- a/orpg/mapper/images.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/mapper/images.py Tue Nov 10 12:11:13 2009 -0600
@@ -27,17 +27,14 @@
#
from __future__ import with_statement
-import urllib
-import Queue
-import thread
+import urllib, Queue, thread, time
from threading import Lock
-import time
from orpg.orpg_wx import *
from orpg.orpgCore import *
from orpg.dirpath import dir_struct
from orpg.tools.orpg_log import logger
-from orpg.tools.orpg_settings import settings
+from orpg.tools.settings import settings
class ImageHandlerClass(object):
__cache = {}
@@ -161,4 +158,4 @@
Cache = property(_getCache)
Queue = property(_getQueue)
-ImageHandler = ImageHandlerClass()
\ No newline at end of file
+ImageHandler = ImageHandlerClass()
diff -r fe4dc5817d5e -r 37d26a98883f orpg/mapper/map_msg.py
--- a/orpg/mapper/map_msg.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/mapper/map_msg.py Tue Nov 10 12:11:13 2009 -0600
@@ -27,7 +27,7 @@
#
__version__ = "$Id: map_msg.py,v 1.16 2007/03/09 14:11:55 digitalxero Exp $"
-from base import *
+#from base import *
from base_msg import *
from background_msg import *
from grid_msg import *
diff -r fe4dc5817d5e -r 37d26a98883f orpg/orpg_version.py
--- a/orpg/orpg_version.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/orpg_version.py Tue Nov 10 12:11:13 2009 -0600
@@ -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 = "091005-00"
+BUILD = "091010-00"
# This version is for network capability.
PROTOCOL_VERSION = "1.2"
diff -r fe4dc5817d5e -r 37d26a98883f orpg/orpg_windows.py
--- a/orpg/orpg_windows.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/orpg_windows.py Tue Nov 10 12:11:13 2009 -0600
@@ -32,6 +32,7 @@
from orpg.orpgCore import *
import orpg.tools.rgbhex
from orpg.dirpath import dir_struct
+from orpg.tools.orpg_log import debug
from orpg.tools.metamenus import MenuEx
class img_helper:
@@ -55,11 +56,10 @@
pos = string.rfind(file_name,'.')
ext = string.lower(file_name[pos+1:])
img_type = 0
- # TaS - sirebral. Replaces 10 lines with 6 lines.
recycle_bin = {"gif": wx.BITMAP_TYPE_GIF, "jpg": wx.BITMAP_TYPE_JPEG,
"jpeg": wx.BITMAP_TYPE_JPEG, "bmp": wx.BITMAP_TYPE_BMP, "png": wx.BITMAP_TYPE_PNG}
if recycle_bin.has_key(ext): img_type = recycle_bin[ext]
- else: img_type = None ## this was imf_type = None. imf?
+ else: img_type = None
del recycle_bin; return img_type
################################
@@ -87,7 +87,7 @@
if style: nbstyle |= style
self.SetWindowStyleFlag(nbstyle)
- #Tas - sirebral. Planned changes to the huge statement below.
+ # Tas - sirebral. Planned changes to the huge statement below.
if tabtheme == 'slanted&aqua':
self.SetGradientColourTo(wx.Color(0, 128, 255))
self.SetGradientColourFrom(wx.WHITE)
@@ -188,14 +188,14 @@
sash = self.GetSashPosition()
if splitmode == wx.SPLIT_VERTICAL:
- pos = mouse_X # Position of the mouse pointer
- second = second_x # Beginning of the second (Right) pane
+ pos = mouse_X # Position of the mouse pointer
+ second = second_x # Beginning of the second (Right) pane
second_size = second_w # Size of the second pane
else:
- pos = mouse_Y # Position of the mouse pointer
- second = second_y # Beginning of the second (Bottom) pane
+ pos = mouse_Y # Position of the mouse pointer
+ second = second_y # Beginning of the second (Bottom) pane
second_size = second_h # Size of the second pane
- sash_size = second - sash # Beginning of sash to beginning of second is the sash size
+ sash_size = second - sash # Beginning of sash to beginning of second is the sash size
if (pos > sash + sash_size and second_size < sash) or (pos < sash and second_size > sash):
# Equivalent to the following
diff -r fe4dc5817d5e -r 37d26a98883f orpg/orpg_xml.py
--- a/orpg/orpg_xml.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/orpg_xml.py Tue Nov 10 12:11:13 2009 -0600
@@ -29,19 +29,16 @@
from orpg import minidom
import string
-from orpg.tools.orpg_log import logger
-from orpg.tools.decorators import debugging
+from orpg.tools.orpg_log import logger, debug
class xml:
- @debugging
+ debug('Deprecated call to orpg_xml!!')
def __init__(self):
pass
- @debugging
def toxml(self, root, pretty=0):
return root.toxml(pretty)
- @debugging
def parseXml(self, s):
"parse and return doc"
try:
@@ -52,7 +49,6 @@
print e
return None
- @debugging
def safe_get_text_node(self, xml_dom):
""" returns the child text node or creates one if doesnt exist """
t_node = xml_dom._get_firstChild()
@@ -61,7 +57,6 @@
t_node = xml_dom.appendChild(t_node)
return t_node
- @debugging
def strip_unicode(self, txt):
for i in xrange(len(txt)):
if txt[i] not in string.printable:
@@ -69,7 +64,6 @@
except: txt = txt.replace(txt[i], '{?}')
return txt
- @debugging
def strip_text(self, txt):
# The following block strips out 8-bit characters
u_txt = ""
@@ -81,5 +75,4 @@
if bad_txt_found: print "Some non 7-bit ASCII characters found and stripped"
return u_txt
-
xml = xml()
diff -r fe4dc5817d5e -r 37d26a98883f orpg/tools/orpg_log.py
--- a/orpg/tools/orpg_log.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/tools/orpg_log.py Tue Nov 10 12:11:13 2009 -0600
@@ -27,7 +27,7 @@
#
from __future__ import with_statement
-import sys, os, os.path, wx, time, traceback, inspect
+import sys, os, os.path, time, traceback, inspect, wx
from orpg.orpgCore import component
from orpg.external.terminalwriter import TerminalWriter
@@ -178,7 +178,7 @@
try: component.get('debugger').AppendText(".. " + str(msg) +'\n')
except: pass
- if log_type & self.log_level or to_console:
+ if log_type and (self.log_level or to_console):
atr = {'msg': msg, 'level': self._lvl_args[log_type]['log_string']}
atr['time'] = time.strftime('[%x %X]', time.localtime(time.time()))
logMsg = '%(time)s (%(level)s) - %(msg)s\n' % (atr)
diff -r fe4dc5817d5e -r 37d26a98883f orpg/tools/orpg_settings.py
--- a/orpg/tools/orpg_settings.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/tools/orpg_settings.py Tue Nov 10 12:11:13 2009 -0600
@@ -30,126 +30,11 @@
from orpg.orpgCore import component
from orpg.dirpath import dir_struct
from rgbhex import *
-import sys
-import os
-from orpg.orpg_xml import xml
+
from orpg.tools.orpg_log import logger
from orpg.tools.validate import validate
from orpg.orpg_xml import xml
-
-class orpgSettings:
- def __init__(self):
- self.xml = component.get("xml")
- self.changes = []
- validate.config_file("settings.xml","default_settings.xml")
- self.filename = dir_struct["user"] + "settings.xml"
- temp_file = open(self.filename)
- txt = temp_file.read()
- temp_file.close()
-
- self.xml_dom = xml.parseXml(txt)
-
- if self.xml_dom is None: self.rebuildSettings()
- self.xml_dom = self.xml_dom._get_documentElement()
-
- def rebuildSettings(self):
- logger.info("Settings file has be corrupted, rebuilding settings.", True)
- try: os.remove(self.filename)
- except: pass
-
- validate.config_file("settings.xml","default_settings.xml")
- temp_file = open(self.filename)
- txt = temp_file.read()
- temp_file.close()
- self.xml_dom = xml.parseXml(txt)
-
- def get_setting(self, name): ##Depricated
- return self.get(name)
-
- def get(self, name):
- try: return self.xml_dom.getElementsByTagName(name)[0].getAttribute("value")
- except: return 0
-
- def get_setting_keys(self): ##Depricated
- return self.get_keys()
-
- def get_keys(self):
- keys = []
- tabs = self.xml_dom.getElementsByTagName("tab")
- for i in xrange(0, len(tabs)):
- if tabs[i].getAttribute("type") == 'grid':
- children = tabs[i]._get_childNodes()
- for c in children: keys.append(c._get_tagName())
- return keys
-
- def set_setting(self, name, value): ##Depricated
- self.change(name, value)
-
- def change(self, name, value):
- self.xml_dom.getElementsByTagName(name)[0].setAttribute("value", value)
-
- def add_setting(self, tab, setting, value, options, help): ##Depricated
- return self.add(tab, setting, value, options, help)
-
- def add(self, tab, setting, value, options, help):
- if len(self.xml_dom.getElementsByTagName(setting)) > 0: return False
- tabs = self.xml_dom.getElementsByTagName("tab")
- newsetting = xml.parseXml('<' + setting + ' value="' + value + '" options="' +
- options + '" help="' + help + '" />')._get_documentElement()
- for i in xrange(0, len(tabs)):
- if tabs[i].getAttribute("name") == tab and tabs[i].getAttribute("type") == 'grid':
- tabs[i].appendChild(newsetting)
- return True
- return False
-
- def add_tab(self, parent, tabname, tabtype):
- tab_xml = ''
- else: tab_xml += 'name="' + tabname + '" type="' + tabtype + '">'
- newtab = xml.parseXml(tab_xml)._get_documentElement()
- if parent != None:
- tabs = self.xml_dom.getElementsByTagName("tab")
- for i in xrange(0, len(tabs)):
- if tabs[i].getAttribute("name") == parent and tabs[i].getAttribute("type") == 'tab':
- children = tabs[i]._get_childNodes()
- for c in children:
- if c.getAttribute("name") == tabname: return False
- tabs[i].appendChild(newtab)
- return True
- else:
- children = self.xml_dom._get_childNodes()
- for c in children:
- if c.getAttribute("name") == tabname: return False
- self.xml_dom.appendChild(newtab)
- return True
- return False
-
- def updateIni(self):
- defaultFile = orpg.dirpath.dir_struct['template'] + 'default_settings.xml'
- temp_file = open(defaultFile)
- txt = temp_file.read()
- temp_file.close()
- default_dom = xml.parseXml(txt)._get_documentElement()
- for child in default_dom.getChildren():
- if child._get_tagName() == 'tab' and child.hasChildNodes(): self.proccessChildren(child)
- default_dom.unlink()
-
- def proccessChildren(self, dom, parent=None):
- if dom._get_tagName() == 'tab':
- self.add_tab(parent, dom.getAttribute("name"), dom.getAttribute("type"))
-
- for child in dom.getChildren():
- if child._get_tagName() == 'tab' and child.hasChildNodes():
- self.proccessChildren(child, dom.getAttribute("name"))
- else:
- self.add_setting(dom.getAttribute("name"), child._get_tagName(),
- child.getAttribute("value"), child.getAttribute("options"),
- child.getAttribute("help"))
-
- def save(self):
- temp_file = open(self.filename, "w")
- temp_file.write(xml.toxml(self.xml_dom,1))
- temp_file.close()
+from orpg.tools.settings import settings
class orpgSettingsWnd(wx.Dialog):
def __init__(self, parent):
@@ -401,5 +286,4 @@
for i in range(0,cols): self.SetColSize(i,col_w)
self.Refresh()
-settings = orpgSettings()
-component.add('settings', settings)
+#settings = orpg.tools.settings.Settings()
diff -r fe4dc5817d5e -r 37d26a98883f orpg/tools/passtool.py
--- a/orpg/tools/passtool.py Thu Nov 05 12:15:19 2009 -0600
+++ b/orpg/tools/passtool.py Tue Nov 10 12:11:13 2009 -0600
@@ -29,7 +29,7 @@
import orpg.orpg_windows
from orpg.orpgCore import component
import traceback
-#from orpg.tools.settings import settings
+from orpg.tools.settings import settings
#####################
## Password Assistant
diff -r fe4dc5817d5e -r 37d26a98883f orpg/tools/settings.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/orpg/tools/settings.py Tue Nov 10 12:11:13 2009 -0600
@@ -0,0 +1,124 @@
+import os
+
+from orpg.tools.orpg_log import logger
+from orpg.tools.validate import validate
+from orpg.orpg_xml import xml
+from orpg.orpgCore import component
+from orpg.dirpath import dir_struct
+
+class Settings:
+ def __init__(self):
+ self.xml = component.get("xml")
+ self.changes = []
+ validate.config_file("settings.xml","default_settings.xml")
+ self.filename = dir_struct["user"] + "settings.xml"
+ temp_file = open(self.filename)
+ txt = temp_file.read()
+ temp_file.close()
+
+ self.xml_dom = xml.parseXml(txt)
+
+ if self.xml_dom is None: self.rebuildSettings()
+ self.xml_dom = self.xml_dom._get_documentElement()
+
+ def rebuildSettings(self):
+ logger.info("Settings file has be corrupted, rebuilding settings.", True)
+ try: os.remove(self.filename)
+ except: pass
+
+ validate.config_file("settings.xml","default_settings.xml")
+ temp_file = open(self.filename)
+ txt = temp_file.read()
+ temp_file.close()
+ self.xml_dom = xml.parseXml(txt)
+
+ def get_setting(self, name): ##Depricated
+ return self.get(name)
+
+ def get(self, name):
+ try: return self.xml_dom.getElementsByTagName(name)[0].getAttribute("value")
+ except: return 0
+
+ def get_setting_keys(self): ##Depricated
+ return self.get_keys()
+
+ def get_keys(self):
+ keys = []
+ tabs = self.xml_dom.getElementsByTagName("tab")
+ for i in xrange(0, len(tabs)):
+ if tabs[i].getAttribute("type") == 'grid':
+ children = tabs[i]._get_childNodes()
+ for c in children: keys.append(c._get_tagName())
+ return keys
+
+ def set_setting(self, name, value): ##Depricated
+ self.change(name, value)
+
+ def change(self, name, value):
+ self.xml_dom.getElementsByTagName(name)[0].setAttribute("value", value)
+
+ def add_setting(self, tab, setting, value, options, help): ##Depricated
+ return self.add(tab, setting, value, options, help)
+
+ def add(self, tab, setting, value, options, help):
+ if len(self.xml_dom.getElementsByTagName(setting)) > 0: return False
+ tabs = self.xml_dom.getElementsByTagName("tab")
+ newsetting = xml.parseXml('<' + setting + ' value="' + value + '" options="' +
+ options + '" help="' + help + '" />')._get_documentElement()
+ for i in xrange(0, len(tabs)):
+ if tabs[i].getAttribute("name") == tab and tabs[i].getAttribute("type") == 'grid':
+ tabs[i].appendChild(newsetting)
+ return True
+ return False
+
+ def add_tab(self, parent, tabname, tabtype):
+ tab_xml = ''
+ else: tab_xml += 'name="' + tabname + '" type="' + tabtype + '">'
+ newtab = xml.parseXml(tab_xml)._get_documentElement()
+ if parent != None:
+ tabs = self.xml_dom.getElementsByTagName("tab")
+ for i in xrange(0, len(tabs)):
+ if tabs[i].getAttribute("name") == parent and tabs[i].getAttribute("type") == 'tab':
+ children = tabs[i]._get_childNodes()
+ for c in children:
+ if c.getAttribute("name") == tabname: return False
+ tabs[i].appendChild(newtab)
+ return True
+ else:
+ children = self.xml_dom._get_childNodes()
+ for c in children:
+ if c.getAttribute("name") == tabname: return False
+ self.xml_dom.appendChild(newtab)
+ return True
+ return False
+
+ def updateIni(self):
+ defaultFile = orpg.dirpath.dir_struct['template'] + 'default_settings.xml'
+ temp_file = open(defaultFile)
+ txt = temp_file.read()
+ temp_file.close()
+ default_dom = xml.parseXml(txt)._get_documentElement()
+ for child in default_dom.getChildren():
+ if child._get_tagName() == 'tab' and child.hasChildNodes(): self.proccessChildren(child)
+ default_dom.unlink()
+
+ def proccessChildren(self, dom, parent=None):
+ if dom._get_tagName() == 'tab':
+ self.add_tab(parent, dom.getAttribute("name"), dom.getAttribute("type"))
+
+ for child in dom.getChildren():
+ if child._get_tagName() == 'tab' and child.hasChildNodes():
+ self.proccessChildren(child, dom.getAttribute("name"))
+ else:
+ self.add_setting(dom.getAttribute("name"), child._get_tagName(),
+ child.getAttribute("value"), child.getAttribute("options"),
+ child.getAttribute("help"))
+
+ def save(self):
+ temp_file = open(self.filename, "w")
+ temp_file.write(xml.toxml(self.xml_dom,1))
+ temp_file.close()
+
+settings = Settings()
+component.add('settings', settings)
diff -r fe4dc5817d5e -r 37d26a98883f start_server.py
--- a/start_server.py Thu Nov 05 12:15:19 2009 -0600
+++ b/start_server.py Tue Nov 10 12:11:13 2009 -0600
@@ -26,7 +26,8 @@
import orpg.networking.mplay_server
import orpg.networking.meta_server_lib
-if __name__ == '__main__':
+print __name__
+if __name__ == '__main__' or __name__ == 'start_server':
gc.set_debug(gc.DEBUG_UNCOLLECTABLE)
gc.enable()