Back to index

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

List of all members.

Public Member Functions

def __init__
def wait
def isAlive
def __init__
def wait
def isAlive

Public Attributes

 pid

Detailed Description

Definition at line 664 of file zopeedit.py.


Constructor & Destructor Documentation

def ExternalEditor.zopeedit.EditorProcess.__init__ (   self,
  command 
)
Launch editor process

Definition at line 665 of file zopeedit.py.

00665 
00666         def __init__(self, command):
00667             """Launch editor process"""
00668             try:
00669                 logger.debug('CreateProcess: %r', command)
00670                 self.handle, nil, nil, nil = CreateProcess(None, command, None, 
00671                                                            None, 1, 0, None, 
00672                                                            None, STARTUPINFO())
00673             except pywintypes.error, e:
00674                 fatalError('Error launching editor process\n'
                           '(%s):\n%s' % (command, e[2]))

Here is the call graph for this function:

Here is the caller graph for this function:

def ExternalEditor.zopeedit.EditorProcess.__init__ (   self,
  command 
)
Launch editor process

Definition at line 728 of file zopeedit.py.

00728 
00729         def __init__(self, command):
00730             """Launch editor process"""
00731             # Prepare the command arguments, we use this regex to 
00732             # split on whitespace and properly handle quoting
00733             arg_re = r"""\s*([^'"]\S+)\s+|\s*"([^"]+)"\s*|\s*'([^']+)'\s*"""
00734             args = re.split(arg_re, command.strip())
00735             args = filter(None, args) # Remove empty elements
00736             self.pid = os.spawnvp(os.P_NOWAIT, args[0], args)
        

Here is the call graph for this function:


Member Function Documentation

Returns true if the editor process is still alive

Definition at line 679 of file zopeedit.py.

00679 
00680         def isAlive(self):
00681             """Returns true if the editor process is still alive"""
00682             return GetExitCodeProcess(self.handle) == 259
00683 
00684 else: # Posix platform
    from time import sleep

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the editor process is still alive

Definition at line 741 of file zopeedit.py.

00741 
00742         def isAlive(self):
00743             """Returns true if the editor process is still alive"""
00744             try:
00745                 exit_pid, exit_status = os.waitpid(self.pid, os.WNOHANG)
00746             except OSError:
00747                 return 0
00748             else:
00749                 return exit_pid != self.pid

Here is the call graph for this function:

def ExternalEditor.zopeedit.EditorProcess.wait (   self,
  timeout 
)
Wait for editor to exit or until timeout

Definition at line 675 of file zopeedit.py.

00675 
00676         def wait(self, timeout):
00677             """Wait for editor to exit or until timeout"""
00678             WaitForSingleObject(self.handle, int(timeout * 1000.0))
                

Here is the call graph for this function:

Here is the caller graph for this function:

def ExternalEditor.zopeedit.EditorProcess.wait (   self,
  timeout 
)
Wait for editor to exit or until timeout

Definition at line 737 of file zopeedit.py.

00737 
00738         def wait(self, timeout):
00739             """Wait for editor to exit or until timeout"""
00740             sleep(timeout)
                

Here is the call graph for this function:


Member Data Documentation

Definition at line 735 of file zopeedit.py.


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