ztfy/utils/tal/interfaces.py
changeset 30 3c237f16b603
child 52 6a542c8e1b96
equal deleted inserted replaced
29:035058514c2d 30:3c237f16b603
       
     1 ### -*- coding: utf-8 -*- ####################################################
       
     2 ##############################################################################
       
     3 #
       
     4 # Copyright (c) 2008-2010 Thierry Florac <tflorac AT ulthar.net>
       
     5 # All Rights Reserved.
       
     6 #
       
     7 # This software is subject to the provisions of the Zope Public License,
       
     8 # Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
       
     9 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
       
    10 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       
    11 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
       
    12 # FOR A PARTICULAR PURPOSE.
       
    13 #
       
    14 ##############################################################################
       
    15 
       
    16 __docformat__ = "restructuredtext"
       
    17 
       
    18 # import standard packages
       
    19 
       
    20 # import Zope3 interfaces
       
    21 
       
    22 # import local interfaces
       
    23 
       
    24 # import Zope3 packages
       
    25 from zope.interface import Interface
       
    26 
       
    27 # import local packages
       
    28 
       
    29 
       
    30 class ITextStartTalesAPI(Interface):
       
    31     """'start' TALES namespace interface"""
       
    32 
       
    33     def __getattr__(attr):
       
    34         """Get first characters of adapted text, without cutting words"""
       
    35 
       
    36 
       
    37 class ITextOutputTalesAPI(Interface):
       
    38     """'text' TALES namespace interface"""
       
    39 
       
    40     def js():
       
    41         """Convert adapted text to a JavaScript compatible output"""
       
    42 
       
    43     def noquotes():
       
    44         """Remove double quotes from adapted text"""
       
    45 
       
    46     def breaks():
       
    47         """Replace '|' by newlines in adapted text"""
       
    48 
       
    49 
       
    50 class IHTMLTalesAPI(Interface):
       
    51     """'html' TALES namespace interface"""
       
    52 
       
    53     def totext():
       
    54         """Convert adapted HTML content to text"""
       
    55 
       
    56     def text():
       
    57         """Convert adapted text to HTML"""
       
    58 
       
    59     def stx():
       
    60         """Convert adapted StructuredText to HTML"""
       
    61 
       
    62     def rest():
       
    63         """Convert adapted reStructuredText to HTML"""