Back to index

plone3  3.1.7
Classes | Functions
ExternalEditor.Plugins.msohtmed Namespace Reference

Classes

class  EditorProcess

Functions

def test

Function Documentation

Definition at line 59 of file msohtmed.py.

00059 
00060 def test():
00061     import os
00062     from time import sleep
00063     from tempfile import mktemp
00064     fn = mktemp('.html')
00065     f = open(fn, 'w')
00066     #f.write('<html>\n  <head></head>\n'
00067     #        '<body><h1>A Test Doc</h1></body>\n</html>')
00068     f.write('<p>hmmm</p>')
00069     f.close()
00070     print 'Connecting to Word...'
00071     f = EditorProcess(fn)
00072     print 'Attached to %s %s' % (`f.wordapp`, f.wordapp.Version)
00073     print ('%s is open...' % fn),
00074     if f.isAlive():
00075         print 'yes'
00076         print 'Test Passed.'
00077     else:
00078         print 'no'
00079         print 'Test Failed.'