mailr5380 - /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:11:
Author: bugman
Date: Mon Apr  7 18:11:33 2008
New Revision: 5380

URL: http://svn.gna.org/viewcvs/relax?rev=5380&view=rev
Log:
Created a data container for storing the pymol command history.


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=5380&r1=5379&r2=5380&view=diff
==============================================================================
--- 1.3/generic_fns/pymol.py (original)
+++ 1.3/generic_fns/pymol.py Mon Apr  7 18:11:33 2008
@@ -29,6 +29,19 @@
 from relax_errors import RelaxError, RelaxImplementError, RelaxNoPipeError, 
RelaxNoSequenceError
 
 
+class Pymol:
+    """Data container for storing information such as the pymol command 
history."""
+
+    command_history = ""
+    """Variable for storing the pymol command history."""
+
+
+# Initialise the Pymol data container.
+pymol_data = Pymol()
+"""Pymol data container instance."""
+
+
+
 def cartoon(run=None):
     """Apply the PyMOL cartoon style and colour by secondary structure."""
 
@@ -56,7 +69,7 @@
 def clear_history():
     """Function for clearing the PyMOL command history."""
 
-    self.command_history = ""
+    pymol_data.command_history = ""
 
 
 def command(run, command):
@@ -144,8 +157,8 @@
     relax_data_store.pymol = popen("pymol -qpK", 'w', 0)
 
     # Execute the command history.
-    if len(self.command_history) > 0:
-        self.pipe_write(self.command_history, store_command=0)
+    if len(pymol_data.command_history) > 0:
+        self.pipe_write(pymol_data.command_history, store_command=0)
         return
 
     # Test if the PDB file has been loaded.
@@ -185,7 +198,7 @@
 
     # Place the command in the command history.
     if store_command:
-        self.command_history = self.command_history + command + "\n"
+        pymol_data.command_history = pymol_data.command_history + command + 
"\n"
 
 
 def tensor_pdb(run=None, file=None):




Related Messages


Powered by MHonArc, Updated Mon Apr 07 18:20:22 2008