Back to index

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

List of all members.

Public Member Functions

def __init__
def name
def convert

Public Attributes

 config
 config_metadata

Static Public Attributes

tuple inputs = ("text/x-rst", "text/restructured",)
string output = "text/html"

Private Attributes

 __name__

Static Private Attributes

 __implements__ = itransform
string __name__ = "rest_to_html"

Detailed Description

Definition at line 5 of file rest.py.


Constructor & Destructor Documentation

def PortalTransforms.transforms.rest.rest.__init__ (   self,
  name = None,
  kwargs 
)

Definition at line 43 of file rest.py.

00043 
00044     def __init__(self, name=None, **kwargs):
00045         if name:
00046             self.__name__ = name
00047 
00048         self.config = {
00049             'inputs': self.inputs,
00050             'output': self.output,
00051             'report_level': 2,
00052             'initial_header_level': 2,
00053             }
00054 
00055         self.config_metadata = {
00056             'inputs' :
00057             ('list', 'Inputs', 'Input(s) MIME type. Change with care.'),
00058             'initial_header_level' :
00059             ('int', 'Initial Header Level',
00060              'Level of first header tag. Setting it to "2" will make '
00061              'the first header be "<h2>".'),
00062             'report_level' :
00063             ('int', 'Report Level',
00064              'Level of error reporting. Set to "1" will display all '
00065              'messages. Setting it to "5" will display no messages.'),
00066             }
00067 
00068         self.config.update(kwargs)
00069 


Member Function Documentation

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

Definition at line 73 of file rest.py.

00073 
00074     def convert(self, orig, data, **kwargs):
00075         # do the format
00076         encoding        = kwargs.get('encoding', 'utf-8')
00077         input_encoding  = kwargs.get('input_encoding', encoding)
00078         output_encoding = kwargs.get('output_encoding', encoding)
00079         language        = kwargs.get('language', 'en')
00080         warnings        = kwargs.get('warnings', None)
00081 
00082         initial_header_level = int(self.config.get('initial_header_level', 2))
00083         report_level = int(self.config.get('report_level', 2))
00084 
00085         settings = {'documentclass': '',
00086                     'traceback': 1,
00087                     }
00088 
00089         html = HTML(orig,
00090                     input_encoding=input_encoding,
00091                     output_encoding=output_encoding,
00092                     language_code=language,
00093                     initial_header_level=initial_header_level,
00094                     report_level=report_level,
00095                     warnings=warnings,
00096                     settings=settings)
00097 
00098         html = html.replace(' class="document"', '', 1)
00099         data.setData(html)
00100         return data

Definition at line 70 of file rest.py.

00070 
00071     def name(self):
00072         return self.__name__

Here is the caller graph for this function:


Member Data Documentation

Definition at line 37 of file rest.py.

string PortalTransforms.transforms.rest.rest.__name__ = "rest_to_html" [static, private]

Definition at line 39 of file rest.py.

Definition at line 45 of file rest.py.

Definition at line 47 of file rest.py.

Definition at line 54 of file rest.py.

tuple PortalTransforms.transforms.rest.rest.inputs = ("text/x-rst", "text/restructured",) [static]

Definition at line 40 of file rest.py.

string PortalTransforms.transforms.rest.rest.output = "text/html" [static]

Definition at line 41 of file rest.py.


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