mailr16257 - in /branches/uf_redesign: prompt/ user_functions/


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

Header


Content

Posted by edward on May 12, 2012 - 12:40:
Author: bugman
Date: Sat May 12 12:40:26 2012
New Revision: 16257

URL: http://svn.gna.org/viewcvs/relax?rev=16257&view=rev
Log:
Converted the vmd user functions to the auto-generation design.


Added:
    branches/uf_redesign/user_functions/vmd.py
      - copied, changed from r16254, branches/uf_redesign/prompt/vmd.py
Removed:
    branches/uf_redesign/prompt/vmd.py
Modified:
    branches/uf_redesign/prompt/__init__.py
    branches/uf_redesign/prompt/interpreter.py
    branches/uf_redesign/user_functions/__init__.py

Modified: branches/uf_redesign/prompt/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/__init__.py?rev=16257&r1=16256&r2=16257&view=diff
==============================================================================
--- branches/uf_redesign/prompt/__init__.py (original)
+++ branches/uf_redesign/prompt/__init__.py Sat May 12 12:40:26 2012
@@ -28,8 +28,8 @@
            'help',
            'interpreter',
            'objects',
-           'tab_completion',
-           'vmd']
+           'tab_completion'
+]
 
 __doc__ = \
 """Package for the prompt based interface.

Modified: branches/uf_redesign/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/interpreter.py?rev=16257&r1=16256&r2=16257&view=diff
==============================================================================
--- branches/uf_redesign/prompt/interpreter.py (original)
+++ branches/uf_redesign/prompt/interpreter.py Sat May 12 12:40:26 2012
@@ -57,9 +57,6 @@
 # User functions.
 from gpl import GPL
 
-# User classes.
-from vmd import Vmd
-
 # User function data structure.
 from user_functions.data import Uf_info; uf_info = Uf_info()
 
@@ -164,9 +161,6 @@
 
         # Place functions in the local namespace.
         objects['gpl'] = objects['GPL'] = GPL()
-
-        # Place the user classes in the local namespace.
-        objects['vmd'] = Vmd()
 
         # Builtin interpreter functions.
         objects['intro_off'] = self.off

Removed: branches/uf_redesign/prompt/vmd.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/vmd.py?rev=16256&view=auto
==============================================================================
--- branches/uf_redesign/prompt/vmd.py (original)
+++ branches/uf_redesign/prompt/vmd.py (removed)
@@ -1,52 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
-#                                                                            
 #
-# This file is part of the program relax.                                    
 #
-#                                                                            
 #
-# relax is free software; you can redistribute it and/or modify              
 #
-# it under the terms of the GNU General Public License as published by       
 #
-# the Free Software Foundation; either version 2 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# relax is distributed in the hope that it will be useful,                   
 #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
-# GNU General Public License for more details.                               
 #
-#                                                                            
 #
-# You should have received a copy of the GNU General Public License          
 #
-# along with relax; if not, write to the Free Software                       
 #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
-#                                                                            
 #
-###############################################################################
-
-# Module docstring.
-"""Module containing the 'vmd' user function class for controlling VMD."""
-__docformat__ = 'plaintext'
-
-# relax module imports.
-from base_class import User_fn_class
-import arg_check
-from generic_fns import vmd
-from status import Status; status = Status()
-
-
-class Vmd(User_fn_class):
-    """Class for interfacing with VMD."""
-
-    def view(self):
-        """Function for viewing the collection of molecules extracted from 
the PDB file.
-
-        Example
-        ~~~~~~~
-
-        relax> vmd.view()
-        """
-
-        # Function intro text.
-        if status.prompt_intro:
-            text = status.ps3 + "vmd.view()"
-            print(text)
-
-        # Execute the functional code.
-        vmd.view()

Modified: branches/uf_redesign/user_functions/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/__init__.py?rev=16257&r1=16256&r2=16257&view=diff
==============================================================================
--- branches/uf_redesign/user_functions/__init__.py (original)
+++ branches/uf_redesign/user_functions/__init__.py Sat May 12 12:40:26 2012
@@ -76,7 +76,8 @@
     'structure',
     'sys_info',
     'temperature',
-    'value'
+    'value',
+    'vmd'
 ]
 
 # Import all the modules to set up the data.
@@ -123,6 +124,7 @@
 import user_functions.sys_info
 import user_functions.temperature
 import user_functions.value
+import user_functions.vmd
 
 # Import the data structure.
 from user_functions.data import Uf_info; uf_info = Uf_info()

Copied: branches/uf_redesign/user_functions/vmd.py (from r16254, 
branches/uf_redesign/prompt/vmd.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/vmd.py?p2=branches/uf_redesign/user_functions/vmd.py&p1=branches/uf_redesign/prompt/vmd.py&r1=16254&r2=16257&rev=16257&view=diff
==============================================================================
--- branches/uf_redesign/prompt/vmd.py (original)
+++ branches/uf_redesign/user_functions/vmd.py Sat May 12 12:40:26 2012
@@ -21,32 +21,31 @@
 
###############################################################################
 
 # Module docstring.
-"""Module containing the 'vmd' user function class for controlling VMD."""
-__docformat__ = 'plaintext'
+"""Module containing the 'vmd' user function data for controlling VMD."""
 
 # relax module imports.
-from base_class import User_fn_class
-import arg_check
 from generic_fns import vmd
-from status import Status; status = Status()
+from graphics import WIZARD_IMAGE_PATH
+from user_functions.data import Uf_info; uf_info = Uf_info()
 
 
-class Vmd(User_fn_class):
-    """Class for interfacing with VMD."""
+# The user function class.
+uf_class = uf_info.add_class('vmd')
+uf_class.title = "Class for interfacing with VMD."
+uf_class.menu_text = "&vmd"
 
-    def view(self):
-        """Function for viewing the collection of molecules extracted from 
the PDB file.
 
-        Example
-        ~~~~~~~
-
-        relax> vmd.view()
-        """
-
-        # Function intro text.
-        if status.prompt_intro:
-            text = status.ps3 + "vmd.view()"
-            print(text)
-
-        # Execute the functional code.
-        vmd.view()
+# The vmd.view user function.
+uf = uf_info.add_uf('vmd.view')
+uf.title = "View the structures loaded into the relax data store using VMD."
+uf.title_short = "Molecular viewing using VMD."
+uf.desc = """
+This will launch VMD with all of the structures loaded into the relax data 
store.
+"""
+uf.prompt_examples = """
+relax> vmd.view()
+"""
+uf.backend = vmd.view
+uf.menu_text = "&view"
+uf.wizard_size = (600, 300)
+uf.wizard_apply_button = False




Related Messages


Powered by MHonArc, Updated Sat May 12 13:00:02 2012