Package tdi :: Package markup :: Module factory
[frames] | no frames]

Source Code for Module tdi.markup.factory

 1  # -*- coding: ascii -*- 
 2  u""" 
 3  :Copyright: 
 4   
 5   Copyright 2013 
 6   Andr\xe9 Malo or his licensors, as applicable 
 7   
 8  :License: 
 9   
10   Licensed under the Apache License, Version 2.0 (the "License"); 
11   you may not use this file except in compliance with the License. 
12   You may obtain a copy of the License at 
13   
14       http://www.apache.org/licenses/LICENSE-2.0 
15   
16   Unless required by applicable law or agreed to in writing, software 
17   distributed under the License is distributed on an "AS IS" BASIS, 
18   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
19   See the License for the specific language governing permissions and 
20   limitations under the License. 
21   
22  =============================== 
23   Default Soup Template Factory 
24  =============================== 
25   
26  Default Soup Template Factory. 
27  """ 
28  __author__ = u"Andr\xe9 Malo" 
29  __docformat__ = "restructuredtext en" 
30  __all__ = ['html', 'xml', 'text'] 
31   
32  from tdi import factory as _factory 
33   
34 -class _soup(object):
35 from tdi.markup.soup import ( 36 builder, 37 decoder, 38 encoder, 39 filters, 40 parser, 41 )
42
43 -class _text(object):
44 from tdi.markup.text import ( 45 builder, 46 decoder, 47 encoder, 48 filters, 49 parser, 50 )
51 52 53 html = _factory.Factory( 54 parser=_soup.parser.DEFAULT_PARSER.html, 55 builder=_soup.builder.SoupBuilder, 56 encoder=_soup.encoder.SoupEncoder, 57 decoder=_soup.decoder.HTMLDecoder, 58 default_eventfilter_list=(_soup.filters.EncodingDetectFilter,), 59 ) 60 61 xml = _factory.Factory( 62 parser=_soup.parser.DEFAULT_PARSER.xml, 63 builder=_soup.builder.SoupBuilder, 64 encoder=_soup.encoder.SoupEncoder, 65 decoder=_soup.decoder.XMLDecoder, 66 default_encoding='utf-8', 67 default_eventfilter_list=(_soup.filters.EncodingDetectFilter,), 68 ) 69 70 71 text = _factory.Factory( 72 parser=_text.parser.TextParser, 73 builder=_text.builder.TextBuilder, 74 encoder=_text.encoder.TextEncoder, 75 decoder=_text.decoder.TextDecoder, 76 default_encoding='utf-8', 77 default_eventfilter_list=(_text.filters.EncodingDetectFilter,), 78 ) 79