Package suds :: Package umx
[hide private]
[frames] | no frames]

Source Code for Package suds.umx

 1  # This program is free software; you can redistribute it and/or modify 
 2  # it under the terms of the (LGPL) GNU Lesser General Public License as 
 3  # published by the Free Software Foundation; either version 3 of the  
 4  # License, or (at your option) any later version. 
 5  # 
 6  # This program is distributed in the hope that it will be useful, 
 7  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
 8  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 9  # GNU Library Lesser General Public License for more details at 
10  # ( http://www.gnu.org/licenses/lgpl.html ). 
11  # 
12  # You should have received a copy of the GNU Lesser General Public License 
13  # along with this program; if not, write to the Free Software 
14  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
15  # written by: Jeff Ortel ( jortel@redhat.com ) 
16   
17  """ 
18  Provides modules containing classes to support 
19  unmarshalling (XML). 
20  """ 
21   
22  from suds.sudsobject import Object 
23   
24   
25   
26 -class Content(Object):
27 """ 28 @ivar node: The content source node. 29 @type node: L{sax.element.Element} 30 @ivar data: The (optional) content data. 31 @type data: L{Object} 32 @ivar text: The (optional) content (xml) text. 33 @type text: basestring 34 """ 35 36 extensions = [] 37
38 - def __init__(self, node, **kwargs):
39 Object.__init__(self) 40 self.node = node 41 self.data = None 42 self.text = None 43 for k,v in kwargs.items(): 44 setattr(self, k, v)
45
46 - def __getattr__(self, name):
47 if name not in self.__dict__: 48 if name in self.extensions: 49 v = None 50 setattr(self, name, v) 51 else: 52 raise AttributeError, \ 53 'Content has no attribute %s' % name 54 else: 55 v = self.__dict__[name] 56 return v
57