mailr11899 - /branches/bieri_gui/gui_bieri/user_functions/script.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 18, 2010 - 18:44:
Author: bugman
Date: Sat Dec 18 18:44:34 2010
New Revision: 11899

URL: http://svn.gna.org/viewcvs/relax?rev=11899&view=rev
Log:
The script user function is now executed in a thread from the GUI so that the 
GUI remains responsive.


Modified:
    branches/bieri_gui/gui_bieri/user_functions/script.py

Modified: branches/bieri_gui/gui_bieri/user_functions/script.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/script.py?rev=11899&r1=11898&r2=11899&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/user_functions/script.py (original)
+++ branches/bieri_gui/gui_bieri/user_functions/script.py Sat Dec 18 18:44:34 
2010
@@ -22,6 +22,9 @@
 
 # Module docstring.
 """The script user functions."""
+
+# Python module imports.
+import thread
 
 # GUI module imports.
 from base import UF_base
@@ -48,5 +51,16 @@
         # Show the relax controller.
         self.gui.controller.Show()
 
+        # Execute the script in a thread.
+        id = thread.start_new_thread(self.script_exec, (file,))
+
+
+    def script_exec(self, file):
+        """Execute the script in a thread.
+
+        @param file:    The script file name.
+        @type file:     str
+        """
+
         # Execute the user function.
         self.interpreter.script(str(file))




Related Messages


Powered by MHonArc, Updated Sun Dec 19 16:00:02 2010