mailr14486 - in /1.3/gui/user_functions: molmol.py pymol.py


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

Header


Content

Posted by edward on August 26, 2011 - 13:58:
Author: bugman
Date: Fri Aug 26 13:58:49 2011
New Revision: 14486

URL: http://svn.gna.org/viewcvs/relax?rev=14486&view=rev
Log:
Created the pymol.macro_run and molmol.macro_run user function GUI pages.


Modified:
    1.3/gui/user_functions/molmol.py
    1.3/gui/user_functions/pymol.py

Modified: 1.3/gui/user_functions/molmol.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/user_functions/molmol.py?rev=14486&r1=14485&r2=14486&view=diff
==============================================================================
--- 1.3/gui/user_functions/molmol.py (original)
+++ 1.3/gui/user_functions/molmol.py Fri Aug 26 13:58:49 2011
@@ -76,6 +76,20 @@
         # Execute the wizard.
         wizard = Wiz_window(size_x=1000, size_y=750, 
title=self.get_title('molmol', 'macro_apply'))
         page = Macro_apply_page(wizard, self.gui)
+        wizard.add_page(page)
+        wizard.run()
+
+
+    def macro_run(self, event):
+        """The molmol.macro_run user function.
+
+        @param event:       The wx event.
+        @type event:        wx event
+        """
+
+        # Execute the wizard.
+        wizard = Wiz_window(size_x=800, size_y=400, 
title=self.get_title('molmol', 'macro_run'))
+        page = Macro_run_page(wizard, self.gui)
         wizard.add_page(page)
         wizard.run()
 
@@ -236,6 +250,37 @@
 
 
 
+class Macro_run_page(UF_page):
+    """The molmol.macro_run() user function page."""
+
+    # Some class variables.
+    image_path = WIZARD_IMAGE_PATH + 'molmol' + sep + 'molmol_logo.png'
+    uf_path = ['molmol', 'macro_run']
+
+    def add_contents(self, sizer):
+        """Add the specific GUI elements.
+
+        @param sizer:   A sizer object.
+        @type sizer:    wx.Sizer instance
+        """
+
+        # Add a file selection.
+        self.file = self.file_selection(sizer, "The macro file:", 
message="Molmol macro file selection", wildcard="Molmol macro files 
(*.mac)|*.mac;*.MAC", style=wx.FD_OPEN, 
tooltip=self.uf._doc_args_dict['file'])
+
+
+    def on_execute(self):
+        """Execute the user function."""
+
+        # The file name.
+        file = gui_to_str(self.file.GetValue())
+        if not file:
+            return
+
+        # Execute the user function.
+        self.gui.interpreter.queue('molmol.macro_run', file=file, dir=None)
+
+
+
 class Macro_write_page(UF_page):
     """The molmol.macro_write() user function page."""
 

Modified: 1.3/gui/user_functions/pymol.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/gui/user_functions/pymol.py?rev=14486&r1=14485&r2=14486&view=diff
==============================================================================
--- 1.3/gui/user_functions/pymol.py (original)
+++ 1.3/gui/user_functions/pymol.py Fri Aug 26 13:58:49 2011
@@ -80,6 +80,20 @@
         wizard.run()
 
 
+    def macro_run(self, event):
+        """The pymol.macro_run user function.
+
+        @param event:       The wx event.
+        @type event:        wx event
+        """
+
+        # Execute the wizard.
+        wizard = Wiz_window(size_x=800, size_y=400, 
title=self.get_title('pymol', 'macro_run'))
+        page = Macro_run_page(wizard, self.gui)
+        wizard.add_page(page)
+        wizard.run()
+
+
     def macro_write(self, event):
         """The pymol.macro_write user function.
 
@@ -89,7 +103,7 @@
 
         # Execute the wizard.
         wizard = Wiz_window(size_x=1000, size_y=750, 
title=self.get_title('pymol', 'macro_write'))
-        page = Write_page(wizard, self.gui)
+        page = Macro_write_page(wizard, self.gui)
         wizard.add_page(page)
         wizard.run()
 
@@ -259,13 +273,12 @@
 
 
 
-class Tensor_pdb_page(UF_page):
-    """The pymol.tensor_pdb() user function page."""
-
-    # Some class variables.
-    image_path = WIZARD_IMAGE_PATH + 'pymol' + sep + 'pymol.png'
-    uf_path = ['pymol', 'tensor_pdb']
-    height_desc = 450
+class Macro_run_page(UF_page):
+    """The pymol.macro_run() user function page."""
+
+    # Some class variables.
+    image_path = WIZARD_IMAGE_PATH + 'pymol' + sep + 'pymol.png'
+    uf_path = ['pymol', 'macro_run']
 
     def add_contents(self, sizer):
         """Add the specific GUI elements.
@@ -275,7 +288,7 @@
         """
 
         # Add a file selection.
-        self.file = self.file_selection(sizer, "The tensor PDB file:", 
message="Tensor PDB file selection", wildcard="PDB files 
(*.pdb)|*.pdb;*.PDB", style=wx.FD_OPEN, 
tooltip=self.uf._doc_args_dict['file'])
+        self.file = self.file_selection(sizer, "The macro file:", 
message="PyMOL macro file selection", wildcard="PyMOL macro files 
(*.pml)|*.pml;*.PML", style=wx.FD_OPEN, 
tooltip=self.uf._doc_args_dict['file'])
 
 
     def on_execute(self):
@@ -283,40 +296,15 @@
 
         # The file name.
         file = gui_to_str(self.file.GetValue())
-
-        # No file.
         if not file:
             return
 
         # Execute the user function.
-        self.gui.interpreter.queue('pymol.tensor_pdb', file=file)
-
-
-
-class View_page(UF_page):
-    """The pymol.view() user function page."""
-
-    # Some class variables.
-    image_path = WIZARD_IMAGE_PATH + 'pymol' + sep + 'pymol.png'
-    uf_path = ['pymol', 'view']
-
-    def add_contents(self, sizer):
-        """Add the specific GUI elements.
-
-        @param sizer:   A sizer object.
-        @type sizer:    wx.Sizer instance
-        """
-
-
-    def on_execute(self):
-        """Execute the user function."""
-
-        # Execute the user function.
-        self.gui.interpreter.queue('pymol.view')
-
-
-
-class Write_page(UF_page):
+        self.gui.interpreter.queue('pymol.macro_run', file=file, dir=None)
+
+
+
+class Macro_write_page(UF_page):
     """The pymol.macro_write() user function page."""
 
     # Some class variables.
@@ -374,3 +362,60 @@
 
         # Execute the user function.
         self.gui.interpreter.queue('pymol.macro_write', data_type=data_type, 
style=style, colour_start=colour_start, colour_end=colour_end, 
colour_list=colour_list, file=file, dir=None, force=force)
+
+
+
+class Tensor_pdb_page(UF_page):
+    """The pymol.tensor_pdb() user function page."""
+
+    # Some class variables.
+    image_path = WIZARD_IMAGE_PATH + 'pymol' + sep + 'pymol.png'
+    uf_path = ['pymol', 'tensor_pdb']
+    height_desc = 450
+
+    def add_contents(self, sizer):
+        """Add the specific GUI elements.
+
+        @param sizer:   A sizer object.
+        @type sizer:    wx.Sizer instance
+        """
+
+        # Add a file selection.
+        self.file = self.file_selection(sizer, "The tensor PDB file:", 
message="Tensor PDB file selection", wildcard="PDB files 
(*.pdb)|*.pdb;*.PDB", style=wx.FD_OPEN, 
tooltip=self.uf._doc_args_dict['file'])
+
+
+    def on_execute(self):
+        """Execute the user function."""
+
+        # The file name.
+        file = gui_to_str(self.file.GetValue())
+
+        # No file.
+        if not file:
+            return
+
+        # Execute the user function.
+        self.gui.interpreter.queue('pymol.tensor_pdb', file=file)
+
+
+
+class View_page(UF_page):
+    """The pymol.view() user function page."""
+
+    # Some class variables.
+    image_path = WIZARD_IMAGE_PATH + 'pymol' + sep + 'pymol.png'
+    uf_path = ['pymol', 'view']
+
+    def add_contents(self, sizer):
+        """Add the specific GUI elements.
+
+        @param sizer:   A sizer object.
+        @type sizer:    wx.Sizer instance
+        """
+
+
+    def on_execute(self):
+        """Execute the user function."""
+
+        # Execute the user function.
+        self.gui.interpreter.queue('pymol.view')




Related Messages


Powered by MHonArc, Updated Fri Aug 26 14:20:02 2011