mailr11233 - /1.3/prompt/pymol_control.py


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

Header


Content

Posted by edward on June 11, 2010 - 15:47:
Author: bugman
Date: Fri Jun 11 15:47:25 2010
New Revision: 11233

URL: http://svn.gna.org/viewcvs/relax?rev=11233&view=rev
Log:
The PyMOL module pymol.cmd is now available within the pymol user function 
class.

This is accessible as pymol.cmd from the prompt/script interface.


Modified:
    1.3/prompt/pymol_control.py

Modified: 1.3/prompt/pymol_control.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/pymol_control.py?rev=11233&r1=11232&r2=11233&view=diff
==============================================================================
--- 1.3/prompt/pymol_control.py (original)
+++ 1.3/prompt/pymol_control.py Fri Jun 11 15:47:25 2010
@@ -23,6 +23,13 @@
 # Module docstring.
 """Module containing the 'pymol' user function class for interacting with 
PyMOL."""
 __docformat__ = 'plaintext'
+
+# Dependency check module.
+import dep_check
+
+# Python module imports.
+if dep_check.pymol_module:
+    import pymol
 
 # relax module imports.
 from base_class import User_fn_class
@@ -33,6 +40,21 @@
 
 class Pymol(User_fn_class):
     """Class for interfacing with PyMOL."""
+
+    def __init__(self, exec_info=None):
+        """Initialise the base class and then load pymol.cmd into here.
+
+        @keyword exec_info: The execution information container.  This must 
contain at least the exec_info.intro boolean variable.  If not supplied, an 
instance will be generated.
+        @type exec_info:    None or class instance
+        """
+
+        # Execute the base class __init__() method.
+        User_fn_class.__init__(self, exec_info)
+
+        # Load the pymol.cmd object, if pymol is available.
+        if dep_check.pymol_module:
+            self.cmd = pymol.cmd
+
 
     def cartoon(self):
         """Apply the PyMOL cartoon style and colour by secondary structure.




Related Messages


Powered by MHonArc, Updated Sat Jun 12 17:40:03 2010