Back to index

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

Classes

class  EditorProcess

Functions

def test

Function Documentation

Definition at line 69 of file winword.py.

00069 
00070 def test():
00071     import os
00072     from time import sleep
00073     from tempfile import mktemp
00074     fn = mktemp('.html')
00075     f = open(fn, 'w')
00076     f.write('<html>\n  <head></head>\n'
00077             '<body><h1>A Test Doc</h1></body>\n</html>')
00078     f.close()
00079     print 'Connecting to Word...'
00080     f = EditorProcess(fn)
00081     print 'Attached to %s %s' % (`f.wordapp`, f.wordapp.Version)
00082     print ('%s is open...' % fn),
00083     if f.isAlive():
00084         print 'yes'
00085         print 'Test Passed.'
00086     else:
00087         print 'no'
00088         print 'Test Failed.'