From: Digital X. <dig...@us...> - 2007-04-14 22:35:15
|
Update of /cvsroot/openrpg/openrpg1/orpg/chat In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22357/orpg/chat Modified Files: chatwnd.py Log Message: Fix for the node refrence system by jester_uk Index: chatwnd.py =================================================================== RCS file: /cvsroot/openrpg/openrpg1/orpg/chat/chatwnd.py,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** chatwnd.py 14 Mar 2007 00:03:12 -0000 1.166 --- chatwnd.py 14 Apr 2007 22:35:15 -0000 1.167 *************** *** 2285,2289 **** cur_loc = 0 #[a-zA-Z0-9 _\-\.] ! reg = re.compile("(!@([a-zA-Z0-9 _\-\.]+:{0,2}[a-zA-Z0-9 _\-\.]*)@!)") matches = reg.findall(s) for i in xrange(0,len(matches)): --- 2285,2289 ---- cur_loc = 0 #[a-zA-Z0-9 _\-\.] ! reg = re.compile("(!@([a-zA-Z0-9 _\-\.]+(:{0,2}[a-zA-Z0-9 _\-\.]*)+)@!)") matches = reg.findall(s) for i in xrange(0,len(matches)): *************** *** 2413,2418 **** return rs ! def resolve_loop(self, dom, path): ! self.log.log("Enter chat_panel->resolve_loop(self, dom, path)", ORPG_DEBUG) for node in dom: --- 2413,2418 ---- return rs ! def resolve_loop(self, dom, nodeName): ! self.log.log("Enter chat_panel->resolve_loop(self, dom, nodeName)", ORPG_DEBUG) for node in dom: *************** *** 2420,2441 **** continue ! if node.getAttribute('class') != 'textctrl_handler': ! (found, value) = self.resolve_loop(node.getChildren(), path) ! ! if not found: continue ! self.log.log("Exit chat_panel->resolve_loop(self, dom, path) return (found, value)", ORPG_DEBUG) ! return (found, value) ! ! if node.getAttribute('name') not in path: ! continue ! ! x = node.getElementsByTagName('text') ! t_node = x[0]._get_firstChild() ! value = t_node._get_nodeValue() self.log.log("Exit chat_panel->resolve_loop(self, dom, path) return (True, value)", ORPG_DEBUG) ! return (True, value) self.log.log("Exit chat_panel->resolve_loop(self, dom, path) return (False, '')", ORPG_DEBUG) --- 2420,2430 ---- continue ! if node.getAttribute('name') != nodeName: continue ! foundNode = node self.log.log("Exit chat_panel->resolve_loop(self, dom, path) return (True, value)", ORPG_DEBUG) ! return (True, foundNode) self.log.log("Exit chat_panel->resolve_loop(self, dom, path) return (False, '')", ORPG_DEBUG) *************** *** 2452,2458 **** dom = gametree.master_dom.getChildren() ! (found, value) = self.resolve_loop(dom, node_path_list) ! if value == "": value = s --- 2441,2455 ---- dom = gametree.master_dom.getChildren() ! for nodeName in node_path_list: ! (found, node) = self.resolve_loop(dom, nodeName) ! if not found: ! break ! dom = node.getChildren() ! if found: ! text = node.getElementsByTagName('text') ! node = text[0]._get_firstChild() ! value = node._get_nodeValue() ! else: value = s |