1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """The script user function definitions."""
24
25
26 import dep_check
27 if dep_check.wx_module:
28 from wx import FD_OPEN
29 else:
30 FD_OPEN = -1
31
32
33 from pipe_control import script
34 from user_functions.data import Uf_info; uf_info = Uf_info()
35 from user_functions.objects import Desc_container
36 from user_functions.wildcards import WILDCARD_RELAX_SCRIPT
37
38
39
40 uf = uf_info.add_uf('script')
41 uf.title = "Execute a relax script."
42 uf.title_short = "Script execution."
43 uf.add_keyarg(
44 name = "file",
45 py_type = "str",
46 arg_type = "file sel",
47 desc_short = "file name",
48 desc = "The name of the file containing the relaxation data.",
49 wiz_filesel_wildcard = WILDCARD_RELAX_SCRIPT,
50 wiz_filesel_style = FD_OPEN
51 )
52 uf.add_keyarg(
53 name = "dir",
54 py_type = "str",
55 arg_type = "dir",
56 desc_short = "directory name",
57 desc = "The directory where the file is located.",
58 can_be_none = True
59 )
60
61 uf.desc.append(Desc_container())
62 uf.desc[-1].add_paragraph("This will execute a relax or any ordinary Python script.")
63 uf.backend = script.script
64 uf.menu_text = "&script"
65 uf.gui_icon = "oxygen.mimetypes.application-x-desktop"
66 uf.wizard_size = (700, 400)
67