mailr14433 - in /1.3/multi: multi_processor_base.py processor.py uni_processor.py


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

Header


Content

Posted by edward on August 25, 2011 - 11:55:
Author: bugman
Date: Thu Aug 25 11:55:56 2011
New Revision: 14433

URL: http://svn.gna.org/viewcvs/relax?rev=14433&view=rev
Log:
Eliminated the restore_stdio() method from the multi package.

The redirection of IO streams is totally incompatible with an IO redirection 
performed by the
underlying Python program.


Modified:
    1.3/multi/multi_processor_base.py
    1.3/multi/processor.py
    1.3/multi/uni_processor.py

Modified: 1.3/multi/multi_processor_base.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/multi/multi_processor_base.py?rev=14433&r1=14432&r2=14433&view=diff
==============================================================================
--- 1.3/multi/multi_processor_base.py (original)
+++ 1.3/multi/multi_processor_base.py Thu Aug 25 11:55:56 2011
@@ -1,6 +1,7 @@
 
###############################################################################
 #                                                                            
 #
 # Copyright (C) 2007 Gary S Thompson (https://gna.org/users/varioustoxins)   
 #
+# Copyright (C) 2011 Edward d'Auvergne                                       
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -144,8 +145,6 @@
 
 
     def post_run(self):
-
-        self.restore_stdio()
 
         super(Multi_processor, self).post_run()
 

Modified: 1.3/multi/processor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/multi/processor.py?rev=14433&r1=14432&r2=14433&view=diff
==============================================================================
--- 1.3/multi/processor.py (original)
+++ 1.3/multi/processor.py Thu Aug 25 11:55:56 2011
@@ -430,10 +430,6 @@
         self._processor_size = processor_size
         '''Number of slave processors available in this processor.'''
 
-        # Default STDOUT and STDERR for restoring later on.
-        self.orig_stdout = sys.__stdout__
-        self.orig_stderr = sys.__stderr__
-
         # Capture the STDIO.
         self.setup_stdio_capture(stdio_capture)
 
@@ -677,21 +673,6 @@
         '''
 
         return int(math.ceil(math.log10(self.processor_size())))
-
-
-    def restore_stdio(self):
-        '''Restore sys.stdout and sys.stderr to the system defaults.
-
-        @note:  sys.stdout and sys.stderr are replaced with sys.__stdout__ 
ans sys.__stderr__.
-        '''
-
-        # First flush.
-        sys.stdout.flush()
-        sys.stderr.flush()
-
-        # Then restore the IO streams.
-        sys.stdout = self.orig_stdout
-        sys.stderr = self.orig_stderr
 
 
     def return_object(self, result):

Modified: 1.3/multi/uni_processor.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/multi/uni_processor.py?rev=14433&r1=14432&r2=14433&view=diff
==============================================================================
--- 1.3/multi/uni_processor.py (original)
+++ 1.3/multi/uni_processor.py Thu Aug 25 11:55:56 2011
@@ -147,7 +147,6 @@
             completed = (i == last_command)
 
             command.run(self, completed)
-            self.restore_stdio()
 
         #self.run_command_queue()
         #TODO: add cheques for empty queues and maps if now warn




Related Messages


Powered by MHonArc, Updated Thu Aug 25 12:00:03 2011