|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric5.compileUiFiles</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.compileUiFiles</h1> |
|
12 <p> |
|
13 Script for eric5 to compile all .ui files to Python source. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr><td>None</td></tr> |
|
22 </table> |
|
23 <h3>Functions</h3> |
|
24 <table> |
|
25 <tr> |
|
26 <td><a href="#compileUiDir">compileUiDir</a></td> |
|
27 <td>Creates Python modules from Qt Designer .ui files in a directory or directory tree.</td> |
|
28 </tr><tr> |
|
29 <td><a href="#compileUiFiles">compileUiFiles</a></td> |
|
30 <td>Compile the .ui files to Python sources.</td> |
|
31 </tr><tr> |
|
32 <td><a href="#compile_ui">compile_ui</a></td> |
|
33 <td>Local function to compile a single .ui file.</td> |
|
34 </tr><tr> |
|
35 <td><a href="#main">main</a></td> |
|
36 <td>The main function of the script.</td> |
|
37 </tr><tr> |
|
38 <td><a href="#pyName">pyName</a></td> |
|
39 <td>Local function to create the Python source file name for the compiled .ui file.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="compileUiDir" ID="compileUiDir"></a> |
|
44 <h2>compileUiDir</h2> |
|
45 <b>compileUiDir</b>(<i>dir, recurse = False, map = None, **compileUi_args</i>) |
|
46 <p> |
|
47 Creates Python modules from Qt Designer .ui files in a directory or |
|
48 directory tree. |
|
49 </p><p> |
|
50 Note: This function is a modified version of the one found in PyQt4. |
|
51 </p><dl> |
|
52 <dt><i>dir</i></dt> |
|
53 <dd> |
|
54 Name of the directory to scan for files whose name ends with |
|
55 '.ui'. By default the generated Python module is created in the same |
|
56 directory ending with '.py'. |
|
57 </dd><dt><i>recurse</i></dt> |
|
58 <dd> |
|
59 flag indicating that any sub-directories should be scanned. |
|
60 </dd><dt><i>map</i></dt> |
|
61 <dd> |
|
62 an optional callable that is passed the name of the directory |
|
63 containing the '.ui' file and the name of the Python module that will be |
|
64 created. The callable should return a tuple of the name of the directory |
|
65 in which the Python module will be created and the (possibly modified) |
|
66 name of the module. |
|
67 </dd><dt><i>compileUi_args</i></dt> |
|
68 <dd> |
|
69 any additional keyword arguments that are passed to |
|
70 the compileUi() function that is called to create each Python module. |
|
71 </dd> |
|
72 </dl> |
|
73 <div align="right"><a href="#top">Up</a></div> |
|
74 <hr /><hr /> |
|
75 <a NAME="compileUiFiles" ID="compileUiFiles"></a> |
|
76 <h2>compileUiFiles</h2> |
|
77 <b>compileUiFiles</b>(<i></i>) |
|
78 <p> |
|
79 Compile the .ui files to Python sources. |
|
80 </p> |
|
81 <div align="right"><a href="#top">Up</a></div> |
|
82 <hr /><hr /> |
|
83 <a NAME="compile_ui" ID="compile_ui"></a> |
|
84 <h2>compile_ui</h2> |
|
85 <b>compile_ui</b>(<i>ui_dir, ui_file</i>) |
|
86 <p> |
|
87 Local function to compile a single .ui file. |
|
88 </p><dl> |
|
89 <dt><i>ui_dir</i></dt> |
|
90 <dd> |
|
91 directory containing the .ui file (string) |
|
92 </dd><dt><i>ui_file</i></dt> |
|
93 <dd> |
|
94 file name of the .ui file (string) |
|
95 </dd> |
|
96 </dl> |
|
97 <div align="right"><a href="#top">Up</a></div> |
|
98 <hr /><hr /> |
|
99 <a NAME="main" ID="main"></a> |
|
100 <h2>main</h2> |
|
101 <b>main</b>(<i>argv</i>) |
|
102 <p> |
|
103 The main function of the script. |
|
104 </p><dl> |
|
105 <dt><i>argv</i></dt> |
|
106 <dd> |
|
107 the list of command line arguments. |
|
108 </dd> |
|
109 </dl> |
|
110 <div align="right"><a href="#top">Up</a></div> |
|
111 <hr /><hr /> |
|
112 <a NAME="pyName" ID="pyName"></a> |
|
113 <h2>pyName</h2> |
|
114 <b>pyName</b>(<i>py_dir, py_file</i>) |
|
115 <p> |
|
116 Local function to create the Python source file name for the compiled .ui file. |
|
117 </p><dl> |
|
118 <dt><i>py_dir</i></dt> |
|
119 <dd> |
|
120 suggested name of the directory (string) |
|
121 </dd><dt><i>py_file</i></dt> |
|
122 <dd> |
|
123 suggested name for the compile source file (string) |
|
124 </dd> |
|
125 </dl><dl> |
|
126 <dt>Returns:</dt> |
|
127 <dd> |
|
128 tuple of directory name (string) and source file name (string) |
|
129 </dd> |
|
130 </dl> |
|
131 <div align="right"><a href="#top">Up</a></div> |
|
132 <hr /> |
|
133 </body></html> |