def open_result_file(self, event): """Open the results in the appropriate program. @param event: The wx event. @type event: wx event """ # Loop over all files. for i in range(self.file_list.GetItemCount()): # Not selected. if not self.file_list.IsSelected(i): continue # Get the type and file. type = self.file_data[i] file = gui_to_str(self.file_list.GetItem(i, 1).GetText()) # Grace files. if type == 'grace': uf_store['grace.view'](file=file, wx_parent=self) # PyMOL macro files. elif type == 'pymol': uf_store['pymol.macro_run'](file=file, wx_parent=self) # Molmol macro files. elif type == 'molmol': uf_store['molmol.macro_run'](file=file, wx_parent=self) # Diffusion tensor PDB. elif type == 'diff_tensor_pdb': # Try and see if PyMOL is installed. if not interpreter.apply('pymol.view'): return # Display the tensor. interpreter.apply('pymol.cartoon') interpreter.apply('pymol.tensor_pdb', file=file) # A special table. elif type == 'Table_of_Results': # The data. model_result = [ ds.relax_gui.table_residue, ds.relax_gui.table_model, ds.relax_gui.table_s2, ds.relax_gui.table_rex, ds.relax_gui.table_te ] # Text files. elif type == 'text': open_file(file, force_text=True) # Open all other files in which ever editor the platform decides on. else: open_file(file)
def open_result_file(self, event): """Open the results in the appropriate program. @param event: The wx event. @type event: wx event """ # Loop over all files. for i in range(self.file_list.GetItemCount()): # Not selected. if not self.file_list.IsSelected(i): continue # Get the type and file. type = self.file_data[i] file = gui_to_str(self.file_list.GetItem(i, 1).GetText()) # Grace files. if type == 'grace': uf_store['grace.view'](file=file, wx_parent=self) # PyMOL macro files. elif type == 'pymol': uf_store['pymol.macro_run'](file=file, wx_parent=self) # Molmol macro files. elif type == 'molmol': uf_store['molmol.macro_run'](file=file, wx_parent=self) # Diffusion tensor PDB. elif type == 'diff_tensor_pdb': # Try and see if PyMOL is installed. if not interpreter.apply('pymol.view'): return # Display the tensor. interpreter.apply('pymol.cartoon') interpreter.apply('pymol.tensor_pdb', file=file) # A special table. elif type == 'Table_of_Results': # The data. model_result = [ds.relax_gui.table_residue, ds.relax_gui.table_model, ds.relax_gui.table_s2, ds.relax_gui.table_rex, ds.relax_gui.table_te] # Text files. elif type == 'text': open_file(file, force_text=True) # Open all other files in which ever editor the platform decides on. else: open_file(file)
def preview_file(self, event=None): """Preview a file. @keyword event: The wx event. @type event: wx event """ # The file name. file = gui_to_str(self._field.GetValue()) # No file, so do nothing. if file == None: return # Open the file as text. open_file(file, force_text=True)
def relax_manual(self, event=None): """Display the relax manual. @keyword event: The wx event. @type event: wx event """ # The PDF manual. file = status.install_path + sep+"docs"+sep+"relax.pdf" # Test if it exists. if not access(file, F_OK): error_message("The relax manual '%s' cannot be found. Please compile using the scons program." % file) return # Open the relax PDF manual using the native PDF reader. open_file(file)