Back to index

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

List of all members.

Public Member Functions

def __init__
def wait
def isAlive

Public Attributes

 pid
 hProcess

Detailed Description

Definition at line 29 of file dreamweaver.py.


Constructor & Destructor Documentation

Launch editor process

Definition at line 30 of file dreamweaver.py.

00030 
00031     def __init__(self, file):
00032         """Launch editor process"""
00033         # let's see if DW's already running
00034         # kind of a hack, but...
00035         WMI = GetObject('winmgmts:')
00036         dwprocesses = WMI.ExecQuery(
00037             'select * from Win32_Process where Name="Dreamweaver.exe"')
00038        dwPath = getDWPathFromRegistry()
00039         if dwPath is None:
00040            raise RuntimeError('Cannot find dreamweaver.exe')
00041         processinfo = win32process.CreateProcess(
00042                 None,
00043                 '%s %s' % (dwPath, file),
00044                 None,   
00045                 None,
00046                 1,
00047                 win32process.CREATE_NEW_CONSOLE,
00048                 None,
00049                 None,
00050                 win32process.STARTUPINFO())
00051         if len(dwprocesses):
00052            # DW is already running
00053             self.pid = dwprocesses[0].Properties_('ProcessId').Value
00054             self.hProcess = win32api.OpenProcess(
00055                win32con.PROCESS_ALL_ACCESS, 0, self.pid)
00056        else:
00057             self.hProcess, nil, self.pid, nil = processinfo
        

Here is the call graph for this function:


Member Function Documentation

Returns true if the editor process is still alive

Definition at line 62 of file dreamweaver.py.

00062 
00063     def isAlive(self):
00064         """Returns true if the editor process is still alive"""
00065         return win32process.GetExitCodeProcess(self.hProcess) == 259
00066 
00067 
# must get Dreamweaver's path from registry
Wait for editor to exit or until timeout

Definition at line 58 of file dreamweaver.py.

00058 
00059     def wait(self, timeout):
00060         """Wait for editor to exit or until timeout"""
00061         win32event.WaitForSingleObject(self.hProcess, int(timeout * 1000.0))
                    

Member Data Documentation

Definition at line 53 of file dreamweaver.py.

Definition at line 52 of file dreamweaver.py.


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