Mercurial > traipse_dev
comparison orpg/mapper/map_msg.py @ 139:8e07c1a2c69b alpha
Traipse Alpha 'OpenRPG' {091123-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, <forms />, <group_atts />, <horizontal />, <cols />, <rows />, <height />, etc... are all tags now. Check
your gametree and look for dead children!!
New Gametree Recursion method, mapping, and context sensitivity. !Infinite Loops return error instead of freezing the
software!
New Syntax added for custom PC sheets
Tip of the Day added, from Core and community
Fixed Whiteboard ID to prevent random line or text deleting. Modified ID's to prevent non updated clients from
ruining the fix.
author | sirebral |
---|---|
date | Mon, 23 Nov 2009 03:22:50 -0600 |
parents | 54446a995007 |
children | 06f10429eedc |
comparison
equal
deleted
inserted
replaced
138:1ed2feab0db9 | 139:8e07c1a2c69b |
---|---|
32 from background_msg import * | 32 from background_msg import * |
33 from grid_msg import * | 33 from grid_msg import * |
34 from miniatures_msg import * | 34 from miniatures_msg import * |
35 from whiteboard_msg import * | 35 from whiteboard_msg import * |
36 from fog_msg import * | 36 from fog_msg import * |
37 import traceback | |
38 from orpg.dirpath import dir_struct | |
39 | |
40 from xml.etree.ElementTree import ElementTree, Element, iselement | |
41 from xml.etree.ElementTree import fromstring, tostring, parse | |
42 | 37 |
43 """ | 38 """ |
44 <map name=? id=? > | 39 <map name=? id=? > |
45 <bg type=? file=? color=? /> | 40 <bg type=? file=? color=? /> |
46 <grid size=? snap=? /> | 41 <grid size=? snap=? /> |
49 </miniatures> | 44 </miniatures> |
50 </map> | 45 </map> |
51 | 46 |
52 """ | 47 """ |
53 | 48 |
54 def Crash(type, value, crash): | |
55 crash_report = open(dir_struct["home"] + 'crash-report.txt', "w") | |
56 traceback.print_exception(type, value, crash, file=crash_report) | |
57 crash_report.close() | |
58 msg = '' | |
59 crash_report = open(dir_struct["home"] + 'crash-report.txt', "r") | |
60 for line in crash_report: msg += line | |
61 print msg | |
62 crash_report.close() | |
63 | |
64 class map_msg(map_element_msg_base): | 49 class map_msg(map_element_msg_base): |
65 | 50 |
66 def __init__(self,reentrant_lock_object = None): | 51 def __init__(self,reentrant_lock_object = None): |
67 self.tagname = "map" | 52 self.tagname = "map" |
68 map_element_msg_base.__init__(self, reentrant_lock_object) | 53 map_element_msg_base.__init__(self,reentrant_lock_object) |
69 | 54 |
70 def init_from_dom(self, xml_dom): | 55 def init_from_dom(self,xml_dom): |
71 self.p_lock.acquire() | 56 self.p_lock.acquire() |
72 if xml_dom.tag == self.tagname: | 57 if xml_dom.tagName == self.tagname: |
73 # If this is a map message, look for the "action=new" | 58 # If this is a map message, look for the "action=new" |
74 # Notice we only do this when the root is a map tag | 59 # Notice we only do this when the root is a map tag |
75 if self.tagname == "map" and xml_dom.get("action") == "new": | 60 if self.tagname == "map" and xml_dom.hasAttribute("action") and xml_dom.getAttribute("action") == "new": |
76 self.clear() | 61 self.clear() |
77 # Process all of the properties in each tag | 62 # Process all of the properties in each tag |
78 if xml_dom.keys(): | 63 if xml_dom.getAttributeKeys(): |
79 for k in xml_dom.keys(): | 64 for k in xml_dom.getAttributeKeys(): |
80 self.init_prop(k, xml_dom.get(k)) | 65 self.init_prop(k,xml_dom.getAttribute(k)) |
81 for c in xml_dom.getchildren(): | 66 for c in xml_dom._get_childNodes(): |
82 name = c.tag | 67 name = c._get_nodeName() |
83 if not self.children.has_key(name): | 68 if not self.children.has_key(name): |
84 if name == "miniatures": self.children[name] = minis_msg(self.p_lock) | 69 if name == "miniatures": self.children[name] = minis_msg(self.p_lock) |
85 elif name == "grid": self.children[name] = grid_msg(self.p_lock) | 70 elif name == "grid": self.children[name] = grid_msg(self.p_lock) |
86 elif name == "bg": self.children[name] = bg_msg(self.p_lock) | 71 elif name == "bg": self.children[name] = bg_msg(self.p_lock) |
87 elif name == "whiteboard": self.children[name] = whiteboard_msg(self.p_lock) | 72 elif name == "whiteboard": self.children[name] = whiteboard_msg(self.p_lock) |
98 raise Exception, "Error attempting to initialize a " + self.tagname + " from a non-<" + self.tagname + "/> element" | 83 raise Exception, "Error attempting to initialize a " + self.tagname + " from a non-<" + self.tagname + "/> element" |
99 self.p_lock.release() | 84 self.p_lock.release() |
100 | 85 |
101 def set_from_dom(self,xml_dom): | 86 def set_from_dom(self,xml_dom): |
102 self.p_lock.acquire() | 87 self.p_lock.acquire() |
103 if xml_dom.tag == self.tagname: | 88 if xml_dom.tagName == self.tagname: |
104 # If this is a map message, look for the "action=new" | 89 # If this is a map message, look for the "action=new" |
105 # Notice we only do this when the root is a map tag | 90 # Notice we only do this when the root is a map tag |
106 if self.tagname == "map" and xml_dom.get("action") == "new": | 91 if self.tagname == "map" and xml_dom.hasAttribute("action") and xml_dom.getAttribute("action") == "new": |
107 self.clear() | 92 self.clear() |
108 # Process all of the properties in each tag | 93 # Process all of the properties in each tag |
109 if xml_dom.keys(): | 94 if xml_dom.getAttributeKeys(): |
110 for k in xml_dom.keys(): | 95 for k in xml_dom.getAttributeKeys(): |
111 self.set_prop(k,xml_dom.get(k)) | 96 self.set_prop(k,xml_dom.getAttribute(k)) |
112 for c in xml_dom.getchildren(): | 97 for c in xml_dom._get_childNodes(): |
113 name = c.tag | 98 name = c._get_nodeName() |
114 if not self.children.has_key(name): | 99 if not self.children.has_key(name): |
115 if name == "miniatures": self.children[name] = minis_msg(self.p_lock) | 100 if name == "miniatures": self.children[name] = minis_msg(self.p_lock) |
116 elif name == "grid": self.children[name] = grid_msg(self.p_lock) | 101 elif name == "grid": self.children[name] = grid_msg(self.p_lock) |
117 elif name == "bg": self.children[name] = bg_msg(self.p_lock) | 102 elif name == "bg": self.children[name] = bg_msg(self.p_lock) |
118 elif name == "whiteboard": self.children[name] = whiteboard_msg(self.p_lock) | 103 elif name == "whiteboard": self.children[name] = whiteboard_msg(self.p_lock) |
132 def get_all_xml(self, action="new", output_action=1): | 117 def get_all_xml(self, action="new", output_action=1): |
133 return map_element_msg_base.get_all_xml(self, action, output_action) | 118 return map_element_msg_base.get_all_xml(self, action, output_action) |
134 | 119 |
135 def get_changed_xml(self, action="update", output_action=1): | 120 def get_changed_xml(self, action="update", output_action=1): |
136 return map_element_msg_base.get_changed_xml(self, action, output_action) | 121 return map_element_msg_base.get_changed_xml(self, action, output_action) |
137 crash = sys.excepthook = Crash |