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

Source Code for Module tdi.markup.factory

 1  # -*- coding: ascii -*- 
 2  r""" 
 3  :Copyright: 
 4   
 5   Copyright 2013 - 2015 
 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  if __doc__: 
29      # pylint: disable = redefined-builtin 
30      __doc__ = __doc__.encode('ascii').decode('unicode_escape') 
31  __author__ = r"Andr\xe9 Malo".encode('ascii').decode('unicode_escape') 
32  __docformat__ = "restructuredtext en" 
33  __all__ = ['html', 'xml', 'text'] 
34   
35  from .. import factory as _factory 
36   
37   
38 -class _soup(object):
39 from .soup import ( # noqa 40 builder, 41 decoder, 42 encoder, 43 filters, 44 parser, 45 )
46 47
48 -class _text(object):
49 from .text import ( # noqa 50 builder, 51 decoder, 52 encoder, 53 filters, 54 parser, 55 )
56 57 58 html = _factory.Factory( 59 parser=_soup.parser.DEFAULT_PARSER.html, 60 builder=_soup.builder.SoupBuilder, 61 encoder=_soup.encoder.SoupEncoder, 62 decoder=_soup.decoder.HTMLDecoder, 63 default_eventfilter_list=(_soup.filters.EncodingDetectFilter,), 64 ) 65 66 xml = _factory.Factory( 67 parser=_soup.parser.DEFAULT_PARSER.xml, 68 builder=_soup.builder.SoupBuilder, 69 encoder=_soup.encoder.SoupEncoder, 70 decoder=_soup.decoder.XMLDecoder, 71 default_encoding='utf-8', 72 default_eventfilter_list=(_soup.filters.EncodingDetectFilter,), 73 ) 74 75 76 text = _factory.Factory( 77 parser=_text.parser.TextParser, 78 builder=_text.builder.TextBuilder, 79 encoder=_text.encoder.TextEncoder, 80 decoder=_text.decoder.TextDecoder, 81 default_encoding='utf-8', 82 default_eventfilter_list=(_text.filters.EncodingDetectFilter,), 83 ) 84