goa/overrides/mttransforms.py
branchtls-sprint
changeset 1802 d628defebc17
parent 0 b97547f5f1fa
child 1977 606923dff11b
equal deleted inserted replaced
1801:672acc730ce5 1802:d628defebc17
     1 """mime type transformation engine for cubicweb, based on mtconverter
     1 """mime type transformation engine for cubicweb, based on mtconverter
     2 
     2 
     3 :organization: Logilab
     3 :organization: Logilab
     4 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 """
     6 """
     7 __docformat__ = "restructuredtext en"
     7 __docformat__ = "restructuredtext en"
     8 
     8 
     9 from logilab import mtconverter
     9 from logilab import mtconverter
    36 ENGINE.add_transform(rest_to_html())
    36 ENGINE.add_transform(rest_to_html())
    37 ENGINE.add_transform(html_to_html())
    37 ENGINE.add_transform(html_to_html())
    38 
    38 
    39 HAS_PIL_TRANSFORMS = False
    39 HAS_PIL_TRANSFORMS = False
    40 HAS_PYGMENTS_TRANSFORMS = False
    40 HAS_PYGMENTS_TRANSFORMS = False
    41     
    41 
    42 class html_to_text(Transform):
    42 class html_to_text(Transform):
    43     inputs = HTML_MIMETYPES
    43     inputs = HTML_MIMETYPES
    44     output = 'text/plain'
    44     output = 'text/plain'
    45     def _convert(self, trdata):
    45     def _convert(self, trdata):
    46         return remove_html_tags(trdata.data)
    46         return remove_html_tags(trdata.data)