Back to index

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

List of all members.

Public Member Functions

def __init__
def convert
def html

Public Attributes

 fullname

Detailed Description

Definition at line 7 of file office_wvware.py.


Constructor & Destructor Documentation

Initialization: create tmp work directory and copy the
document into a file

Definition at line 9 of file office_wvware.py.

00009 
00010     def __init__(self, name, data):
00011         """ Initialization: create tmp work directory and copy the
00012         document into a file"""
00013         commandtransform.__init__(self, name, binary="wvHtml")
00014         name = self.name()
00015         if not name.endswith('.doc'):
00016             name = name + ".doc"
00017         self.tmpdir, self.fullname = self.initialize_tmpdir(data, filename=name)

Here is the call graph for this function:


Member Function Documentation

Definition at line 18 of file office_wvware.py.

00018 
00019     def convert(self):
00020         "Convert the document"
00021         tmpdir = self.tmpdir
00022 
00023         # for windows, install wvware from GnuWin32 at C:\Program Files\GnuWin32\bin
00024         # you can use:
00025         # wvware.exe -c ..\share\wv\wvHtml.xml --charset=utf-8 -d d:\temp d:\temp\test.doc > test.html
00026 
00027         if os.name == 'posix':
00028             os.system('cd "%s" && %s --charset=utf-8 "%s" "%s.html"' % (tmpdir, self.binary,
00029                                                              self.fullname,
00030                                                              self.__name__))

Definition at line 31 of file office_wvware.py.

00031 
00032     def html(self):
00033         htmlfile = open("%s/%s.html" % (self.tmpdir, self.__name__), 'r')
00034         html = htmlfile.read()
00035         htmlfile.close()
00036         html = scrubHTML(html)
00037         body = bodyfinder(html)
00038         return body

Here is the call graph for this function:


Member Data Documentation

Definition at line 16 of file office_wvware.py.


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