Update of /cvsroot/openrpg/openrpg1/orpg/chat
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19663/orpg/chat
Modified Files:
Tag: BRANCH-1-7-1
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.161.2.2
retrieving revision 1.161.2.3
diff -C2 -d -r1.161.2.2 -r1.161.2.3
*** chatwnd.py 14 Mar 2007 00:02:35 -0000 1.161.2.2
--- chatwnd.py 18 Apr 2007 21:54:54 -0000 1.161.2.3
***************
*** 181,185 ****
def OnLinkClicked(self, linkinfo):
href = linkinfo.GetHref()
! webbrowser.open(href)
# def OnLinkClicked - end
--- 181,186 ----
def OnLinkClicked(self, linkinfo):
href = linkinfo.GetHref()
! wb = webbrowser.get()
! wb.open(href)
# def OnLinkClicked - end
***************
*** 2247,2251 ****
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)):
--- 2248,2252 ----
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)):
***************
*** 2375,2380 ****
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:
--- 2376,2381 ----
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:
***************
*** 2382,2403 ****
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)
--- 2383,2393 ----
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)
***************
*** 2414,2420 ****
dom = gametree.master_dom.getChildren()
! (found, value) = self.resolve_loop(dom, node_path_list)
! if value == "":
value = s
--- 2404,2418 ----
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
|