Package user_functions :: Module script
[hide private]
[frames] | no frames]

Source Code for Module user_functions.script

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2012 Edward d'Auvergne                                        # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 6  #                                                                             # 
 7  # This program is free software: you can redistribute it and/or modify        # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation, either version 3 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # This program is distributed in the hope that it will be useful,             # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
19  #                                                                             # 
20  ############################################################################### 
21   
22  # Module docstring. 
23  """The script user function definitions.""" 
24   
25  # relax module imports. 
26  from pipe_control import script 
27  from user_functions.data import Uf_info; uf_info = Uf_info() 
28  from user_functions.objects import Desc_container 
29  from user_functions.wildcards import WILDCARD_RELAX_SCRIPT 
30   
31   
32  # The script user function. 
33  uf = uf_info.add_uf('script') 
34  uf.title = "Execute a relax script." 
35  uf.title_short = "Script execution." 
36  uf.add_keyarg( 
37      name = "file", 
38      arg_type = "file sel read", 
39      desc_short = "file name", 
40      desc = "The name of the file containing the relaxation data.", 
41      wiz_filesel_wildcard = WILDCARD_RELAX_SCRIPT, 
42  ) 
43  uf.add_keyarg( 
44      name = "dir", 
45      arg_type = "dir", 
46      desc_short = "directory name", 
47      desc = "The directory where the file is located.", 
48      can_be_none = True 
49  ) 
50  # Description. 
51  uf.desc.append(Desc_container()) 
52  uf.desc[-1].add_paragraph("This will execute a relax or any ordinary Python script.") 
53  uf.backend = script.script 
54  uf.menu_text = "&script" 
55  uf.gui_icon = "oxygen.mimetypes.application-x-desktop" 
56  uf.wizard_size = (700, 400) 
57