comparison orpg/pluginhandler.py @ 216:a00b40ee92fc beta

Traipse Beta 'OpenRPG' {100430-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 (Patch-2) New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start New to Mini Lin node, change title in design mode Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up Fix to Mini Lib node that was preventing use Fix to plugins that parce dice but did not call InterParse Fix to nodes for name changing by double click Fix to Game Tree, node ordering on drag and drop corrected
author sirebral
date Fri, 30 Apr 2010 05:40:52 -0500
parents c54768cffbd4
children
comparison
equal deleted inserted replaced
213:8b7bb1d72c1c 216:a00b40ee92fc
1 from orpg.orpg_wx import * 1 from orpg.orpg_wx import *
2 from orpg.orpgCore import component 2 from orpg.orpgCore import component
3 from xml.etree.ElementTree import ElementTree, Element, parse
4 from xml.etree.ElementTree import fromstring, tostring
3 5
4 class PluginHandler: 6 class PluginHandler:
5 # Initialization subroutine. 7 # Initialization subroutine.
6 # 8 #
7 # !self : instance of self 9 # !self : instance of self
80 def plugin_add_setting(self, setting, value, options, help): 82 def plugin_add_setting(self, setting, value, options, help):
81 self.settings.add_tab('Plugins', self.name, 'grid') 83 self.settings.add_tab('Plugins', self.name, 'grid')
82 self.settings.add_setting(self.name, setting, value, options, help) 84 self.settings.add_setting(self.name, setting, value, options, help)
83 85
84 def plugin_send_msg(self, to, plugin_msg): 86 def plugin_send_msg(self, to, plugin_msg):
85 xml_dom = self.xml.parseXml(plugin_msg) 87 xml_dom = fromstring(plugin_msg)
86 xml_dom = xml_dom._get_documentElement() 88 #xml_dom = xml_dom.getroot()
87 xml_dom.setAttribute('from', str(self.session.id)) 89 xml_dom.set('from', str(self.session.id))
88 xml_dom.setAttribute('to', str(to)) 90 xml_dom.set('to', str(to))
89 xml_dom.setAttribute('group_id', str(self.session.group_id)) 91 xml_dom.set('group_id', str(self.session.group_id))
90 tag_name = xml_dom._get_tagName() 92 tag_name = xml_dom.tag
91 if not tag_name in self.session.core_msg_handlers: 93 if not tag_name in self.session.core_msg_handlers:
92 xml_msg = '<plugin to="' + str(to) 94 xml_msg = '<plugin to="' + str(to)
93 xml_msg += '" from="' + str(self.session.id) 95 xml_msg += '" from="' + str(self.session.id)
94 xml_msg += '" group_id="' + str(self.session.group_id) 96 xml_msg += '" group_id="' + str(self.session.group_id)
95 xml_msg += '" />' + xml_dom.toxml() 97 xml_msg += '" />' + tostring(xml_dom)
96 self.session.outbox.put(xml_msg) 98 self.session.outbox.put(xml_msg)
97 else: 99 else:
98 #Spoofing attempt 100 #Spoofing attempt
99 pass 101 pass
100 xml_dom.unlink() 102 #xml_dom.unlink()
101 103
102 def message(self, text): 104 def message(self, text):
103 return text 105 return text
104 106
105 def pre_parse(self, text): 107 def pre_parse(self, text):