Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
ExternalEditor.Plugins.msohtmed.EditorProcess Class Reference

List of all members.

Public Member Functions

def __init__
def wait
def isAlive

Public Attributes

 wordapp
 file

Detailed Description

Definition at line 24 of file msohtmed.py.


Constructor & Destructor Documentation

Launch editor process

Definition at line 25 of file msohtmed.py.

00025 
00026     def __init__(self, file):
00027         """Launch editor process"""
00028         word = win32com.client.Dispatch('Word.Application')
00029         # Try to open the file, keep retrying until we succeed or timeout
00030         i = 0
00031         timeout = 45
00032         while i < timeout:
00033             try:
00034                 word.Documents.Open(file, Format=8)
00035               print 'Opening...'
00036             except:
00037                 i += 1
00038                 if i >= timeout:
00039                     raise RuntimeError('Could not launch Word.')
00040                 sleep(1)
00041             else:
00042                 break
00043         word.Visible = 1
00044         self.wordapp = word
00045         self.file = file
        

Member Function Documentation

Returns true if the editor process is still alive

Definition at line 50 of file msohtmed.py.

00050 
00051     def isAlive(self):
00052         """Returns true if the editor process is still alive"""
00053               try:
00054             self.wordapp.Documents(self.file)
00055         except:
00056             return 0
00057         else:
00058             return 1
        
Wait for editor to exit or until timeout

Definition at line 46 of file msohtmed.py.

00046 
00047     def wait(self, timeout):
00048         """Wait for editor to exit or until timeout"""
00049         sleep(timeout)
            

Member Data Documentation

Definition at line 44 of file msohtmed.py.

Definition at line 43 of file msohtmed.py.


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