Package suds :: Package mx :: Module basic
[hide private]
[frames] | no frames]

Source Code for Module suds.mx.basic

 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 basic I{marshaller} classes. 
19  """ 
20   
21  from logging import getLogger 
22  from suds import * 
23  from suds.mx import * 
24  from suds.mx.core import Core 
25   
26  log = getLogger(__name__) 
27   
28   
29 -class Basic(Core):
30 """ 31 A I{basic} (untyped) marshaller. 32 """ 33
34 - def process(self, value, tag=None):
35 """ 36 Process (marshal) the tag with the specified value using the 37 optional type information. 38 @param value: The value (content) of the XML node. 39 @type value: (L{Object}|any) 40 @param tag: The (optional) tag name for the value. The default is 41 value.__class__.__name__ 42 @type tag: str 43 @return: An xml node. 44 @rtype: L{Element} 45 """ 46 content = Content(tag=tag, value=value) 47 result = Core.process(self, content) 48 return result
49