Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | Static Private Attributes
PortalTransforms.transforms.text_to_html.TextToHTML Class Reference
Collaboration diagram for PortalTransforms.transforms.text_to_html.TextToHTML:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def name
def __getattr__
def convert

Public Attributes

 config
 config_metadata

Static Public Attributes

string output = "text/html"

Private Attributes

 __name__

Static Private Attributes

 __implements__ = itransform
string __name__ = "text_to_html"

Detailed Description

simple transform which wrap raw text in a verbatim environment

Definition at line 6 of file text_to_html.py.


Constructor & Destructor Documentation

def PortalTransforms.transforms.text_to_html.TextToHTML.__init__ (   self,
  name = None,
  inputs = ('text/plain', 
)

Definition at line 14 of file text_to_html.py.

00014 
00015     def __init__(self, name=None, inputs=('text/plain',)):
00016         self.config = { 'inputs' : inputs, }
00017         self.config_metadata = {
00018             'inputs' : ('list', 'Inputs', 'Input(s) MIME type. Change with care.'),
00019             }
00020         if name:
00021             self.__name__ = name


Member Function Documentation

Definition at line 25 of file text_to_html.py.

00025 
00026     def __getattr__(self, attr):
00027         if attr == 'inputs':
00028             return self.config['inputs']
00029         if attr == 'output':
00030             return self.config['output']
00031         raise AttributeError(attr)

Here is the caller graph for this function:

def PortalTransforms.transforms.text_to_html.TextToHTML.convert (   self,
  orig,
  data,
  kwargs 
)

Definition at line 32 of file text_to_html.py.

00032 
00033     def convert(self, orig, data, **kwargs):
00034         # Replaces all line breaks with a br tag, and wraps it in a p tag.
00035         data.setData('<p>%s</p>' % html_quote(orig.strip()).replace('\n', '<br />'))
00036         return data

Definition at line 22 of file text_to_html.py.

00022 
00023     def name(self):
00024         return self.__name__

Here is the caller graph for this function:


Member Data Documentation

Definition at line 9 of file text_to_html.py.

string PortalTransforms.transforms.text_to_html.TextToHTML.__name__ = "text_to_html" [static, private]

Definition at line 11 of file text_to_html.py.

Definition at line 20 of file text_to_html.py.

Definition at line 15 of file text_to_html.py.

Definition at line 16 of file text_to_html.py.

Definition at line 12 of file text_to_html.py.


The documentation for this class was generated from the following file: