Back to index

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

List of all members.

Public Member Functions

def __init__
def convert
def invokeCommand

Static Public Attributes

tuple inputs = ('application/rtf',)
string output = 'text/html'
string binaryName = "rtf-converter"

Static Private Attributes

 __implements__ = itransform
string __name__ = "rtf_to_html"

Detailed Description

Definition at line 11 of file rtf_to_html.py.


Constructor & Destructor Documentation

Definition at line 20 of file rtf_to_html.py.

00020 
00021     def __init__(self):
00022         commandtransform.__init__(self, binary=self.binaryName)


Member Function Documentation

def PortalTransforms.transforms.rtf_to_html.rtf_to_html.convert (   self,
  data,
  cache,
  kwargs 
)

Definition at line 23 of file rtf_to_html.py.

00023 
00024     def convert(self, data, cache, **kwargs):
00025         kwargs['filename'] = 'unknow.rtf'
00026 
00027         tmpdir, fullname = self.initialize_tmpdir(data, **kwargs)
00028         html = self.invokeCommand(tmpdir, fullname)
00029         path, images = self.subObjects(tmpdir)
00030         objects = {}
00031         if images:
00032             self.fixImages(path, images, objects)
00033         self.cleanDir(tmpdir)
00034         cache.setData(bodyfinder(html))
00035         cache.setSubObjects(objects)
00036         return cache

Here is the call graph for this function:

def PortalTransforms.transforms.rtf_to_html.rtf_to_html.invokeCommand (   self,
  tmpdir,
  fullname 
)

Definition at line 37 of file rtf_to_html.py.

00037 
00038     def invokeCommand(self, tmpdir, fullname):
00039         # FIXME: windows users...
00040         htmlfile = "%s/%s.html" % (tmpdir, sansext(fullname))
00041         cmd = 'cd "%s" && %s -o %s "%s" 2>error_log 1>/dev/null' % (
00042             tmpdir, self.binary, htmlfile, fullname)
00043         os.system(cmd)
00044         try:
00045             html = open(htmlfile).read()
00046         except:
00047             try:
00048                 return open("%s/error_log" % tmpdir, 'r').read()
00049             except:
00050                 return ''
00051         return html

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 12 of file rtf_to_html.py.

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

Definition at line 14 of file rtf_to_html.py.

Definition at line 18 of file rtf_to_html.py.

tuple PortalTransforms.transforms.rtf_to_html.rtf_to_html.inputs = ('application/rtf',) [static]

Definition at line 15 of file rtf_to_html.py.

Definition at line 16 of file rtf_to_html.py.


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