[strongwind] Disable setting process group by default



commit 15cc1d3eaa9f9c5b4ad18225021a762de5a8e63e
Author: Brad Taylor <brad getcoded net>
Date:   Wed Jun 17 11:23:31 2009 -0400

    Disable setting process group by default
    
    Setting the process group can cause hangs with applications that don't use
    wrapper scripts.

 ChangeLog           |    5 +++++
 strongwind/cache.py |    8 ++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e75a520..fbfd67f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-17  Brad Taylor  <brad getcoded net>
+
+	* strongwind/cache.py: Disable setting the process group by default as
+	it can cause problems with applications that don't use wrapper scripts.
+
 2009-06-16  Brad Taylor  <brad getcoded net>
 
 	* strongwind/cache.py: Set the process group of our launched
diff --git a/strongwind/cache.py b/strongwind/cache.py
index 7aed1c3..67dbaac 100644
--- a/strongwind/cache.py
+++ b/strongwind/cache.py
@@ -164,7 +164,7 @@ def getApplicationsList():
 
     return _applications.values()
 
-def launchApplication(args=[], name=None, find=None, cwd=None, env=None, wait=config.MEDIUM_DELAY, cache=True, logString=None):
+def launchApplication(args=[], name=None, find=None, cwd=None, env=None, wait=config.MEDIUM_DELAY, cache=True, logString=None, setpgid=False):
     '''
     Launch an application with accessibility enabled
 
@@ -242,8 +242,12 @@ def launchApplication(args=[], name=None, find=None, cwd=None, env=None, wait=co
         '''
         os.setpgid(0, 0)
 
+    preexec_fn = None
+    if setpgid:
+        preexec_fn = group_setup
+
     # launch the application
-    subproc = subprocess.Popen(args, cwd=cwd, env=env, preexec_fn=group_setup)
+    subproc = subprocess.Popen(args, cwd=cwd, env=env, preexec_fn=preexec_fn)
 
     # wait for the application to launch and for the applications list to
     # settle.  if we try to list the desktop's applications too soon, we get



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]