Back to index

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

List of all members.

Public Member Functions

def __init__
def wait
def isAlive

Public Attributes

 powerpntapp
 file

Detailed Description

Definition at line 24 of file powerpnt.py.


Constructor & Destructor Documentation

Launch editor process

Definition at line 25 of file powerpnt.py.

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

Member Function Documentation

Returns true if the editor process is still alive

Definition at line 50 of file powerpnt.py.

00050 
00051     def isAlive(self):
00052         """Returns true if the editor process is still alive"""
00053         try:
00054             self.powerpntapp.Presentations(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 powerpnt.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 powerpnt.py.

Definition at line 43 of file powerpnt.py.


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