Author: bugman Date: Tue Apr 8 10:35:07 2008 New Revision: 5403 URL: http://svn.gna.org/viewcvs/relax?rev=5403&view=rev Log: Updated the create_macro() function to the new relax design. 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=5403&r1=5402&r2=5403&view=diff ============================================================================== --- 1.3/generic_fns/pymol.py (original) +++ 1.3/generic_fns/pymol.py Tue Apr 8 10:35:07 2008 @@ -28,6 +28,7 @@ from data import Data as relax_data_store from relax_errors import RelaxError, RelaxImplementError, RelaxNoPipeError, RelaxNoSequenceError from relax_io import file_root, test_binary +from specific_fns.setup import get_specific_fn class Pymol: @@ -161,17 +162,33 @@ pymol.pipe_write(command) -def create_macro(): - """Function for creating an array of PyMOL commands.""" - - # Function type. - self.function_type = relax_data_store.run_types[relax_data_store.run_names.index(self.run)] +def create_macro(data_type=None, style="classic", colour_start=None, colour_end=None, colour_list=None): + """Function for creating an array of PyMOL commands. + + @keyword data_type: The data type ot map to the structure. + @type data_type: str + @keyword style: The style of the macro. + @type style: str + @keyword colour_start: The starting colour of the linear gradient. + @type colour_start: str or RBG colour array (len 3 with vals from 0 to 1) + @keyword colour_end: The ending colour of the linear gradient. + @type colour_end: str or RBG colour array (len 3 with vals from 0 to 1) + @keyword colour_list: The colour list to search for the colour names. Can be either 'molmol' + or 'x11'. + @type colour_list: str or None + """ + + # Alias the current data pipe. + cdp = relax_data_store[relax_data_store.current_pipe] # Specific PyMOL macro creation function. - pymol_macro = self.relax.specific_setup.setup('pymol_macro', self.function_type) + pymol_macro = get_specific_fn('pymol_macro', cdp.pipe_type) # Get the macro. - self.commands = pymol_macro(self.run, self.data_type, self.style, self.colour_start, self.colour_end, self.colour_list) + commands = pymol_macro(data_type, style, colour_start, colour_end, colour_list) + + # Return the macro commands. + return commands def macro_exec(run=None, data_type=None, style="classic", colour_start=None, colour_end=None, colour_list=None):