mailr5387 - /1.3/generic_fns/pymol.py


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

Header


Content

Posted by edward on April 07, 2008 - 18:37:
Author: bugman
Date: Mon Apr  7 18:37:05 2008
New Revision: 5387

URL: http://svn.gna.org/viewcvs/relax?rev=5387&view=rev
Log:
Placed the PyMOL pipe into the PyMOL data object.

It is no longer stored in the relax data store.  This will have the obvious 
effect of having a
single instance of PyMOL running, and not a seperate instance per data pipe.


Modified:
    1.3/generic_fns/pymol.py

Modified: 1.3/generic_fns/pymol.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pymol.py?rev=5387&r1=5386&r2=5387&view=diff
==============================================================================
--- 1.3/generic_fns/pymol.py (original)
+++ 1.3/generic_fns/pymol.py Mon Apr  7 18:37:05 2008
@@ -31,11 +31,18 @@
 
 
 class Pymol:
-    """Data container for storing information such as the pymol command 
history."""
+    """Data container for storing PyMOL related data.
+
+    This includes information such as the PyMOL command history.  Also 
stored is the file handle to
+    the PyMOL child process pipe.
+    """
 
     command_history = ""
     """Variable for storing the pymol command history."""
 
+    pipe = None
+    """Writable pipe (file handle) to the PyMOL child process."""
+
 
     def clear_history(self):
         """Method for clearing the PyMOL command history."""
@@ -50,7 +57,7 @@
         self.relax.IO.test_binary('pymol')
 
         # Open the PyMOL pipe.
-        relax_data_store.pymol = popen("pymol -qpK", 'w', 0)
+        self.pymol = popen("pymol -qpK", 'w', 0)
 
         # Execute the command history.
         if len(pymol_data.command_history) > 0:
@@ -66,12 +73,12 @@
         """Function for testing if the PyMOL pipe is open."""
 
         # Test if a pipe has been opened.
-        if not hasattr(relax_data_store, 'pymol'):
+        if not hasattr(self, 'pymol'):
             return 0
 
         # Test if the pipe has been broken.
         try:
-            relax_data_store.pymol.write('\n')
+            self.pymol.write('\n')
         except IOError:
             return 0
 
@@ -90,7 +97,7 @@
             self.pipe_open()
 
         # Write the command to the pipe.
-        relax_data_store.pymol.write(command + '\n')
+        self.pymol.write(command + '\n')
 
         # Place the command in the command history.
         if store_command:




Related Messages


Powered by MHonArc, Updated Mon Apr 07 18:40:11 2008