Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
PortalTransforms.transforms.rtf_to_xml.rtf_to_xml Class Reference
Inheritance diagram for PortalTransforms.transforms.rtf_to_xml.rtf_to_xml:
Inheritance graph
[legend]
Collaboration diagram for PortalTransforms.transforms.rtf_to_xml.rtf_to_xml:
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/xml'
string binaryName = "rtf2xml"

Static Private Attributes

 __implements__ = itransform
string __name__ = "rtf_to_xml"

Detailed Description

Definition at line 10 of file rtf_to_xml.py.


Constructor & Destructor Documentation

Definition at line 19 of file rtf_to_xml.py.

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


Member Function Documentation

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

Definition at line 22 of file rtf_to_xml.py.

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

Here is the call graph for this function:

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

Definition at line 36 of file rtf_to_xml.py.

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

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 11 of file rtf_to_xml.py.

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

Definition at line 13 of file rtf_to_xml.py.

Definition at line 17 of file rtf_to_xml.py.

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

Definition at line 14 of file rtf_to_xml.py.

Definition at line 15 of file rtf_to_xml.py.


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