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

Source Code for Module tdi.markup.factory

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