Mercurial > fife-parpg
diff engine/extensions/serializers/xmlobject.py @ 129:9a1529f9625e
* Indentation patch by GreyGhost
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 07 Aug 2008 15:46:46 +0000 |
parents | 4a0efb7baf70 |
children | 3fddb45c0304 |
line wrap: on
line diff
--- a/engine/extensions/serializers/xmlobject.py Wed Aug 06 22:35:27 2008 +0000 +++ b/engine/extensions/serializers/xmlobject.py Thu Aug 07 15:46:46 2008 +0000 @@ -28,16 +28,16 @@ isobjectfile = True f = self.vfs.open(self.filename) f.thisown = 1 - + obj_identifier = '<?fife type="object"?>' try: s = f.readString(len(obj_identifier)) except fife.IndexOverflow: isobjectfile = False - + if isobjectfile and s != obj_identifier: isobjectfile = False - + if not isobjectfile: raise WrongFileType('Tried to open non-object file %s with XMLObjectLoader.' % self.filename) self.do_load_resource(f) @@ -51,7 +51,7 @@ def parse_object(self, object): if self.node.tag != 'object': raise InvalidFormat('Expected <object> tag, but found <%s>.' % self.node.tag) - + id = object.get('id') if not id: raise InvalidFormat('<object> declared without an id attribute.') @@ -59,7 +59,7 @@ nspace = object.get('namespace') if not nspace: raise InvalidFormat('<object> %s declared without a namespace attribute.' % str(id)) - + obj = None parent = object.get('parent', None) if parent: @@ -81,7 +81,7 @@ fife.ObjectVisual.create(obj) obj.setBlocking(bool( object.get('blocking', False) )) obj.setStatic(bool( object.get('static', False) )) - + pather = object.get('pather', 'RoutePather') obj.setPather( self.model.getPather(pather) ) @@ -110,7 +110,7 @@ id = action.get('id') if not id: raise InvalidFormat('<action> declared without an id attribute.') - + act_obj = object.createAction(str(id)) fife.ActionVisual.create(act_obj) self.parse_animations(action, act_obj) @@ -130,4 +130,3 @@ animation = self.anim_pool.getAnimation(anim_id) action.get2dGfxVisual().addAnimation(int( anim.get('direction', 0) ), anim_id) action.setDuration(animation.getDuration()) -