Documentation/Source/eric5.compileUiFiles.html

changeset 58
37f0444c3479
parent 21
b88a0e6268bd
child 409
0ea528e80202
equal deleted inserted replaced
57:81326a94fdca 58:37f0444c3479
20 </style> 20 </style>
21 </head> 21 </head>
22 <body><a NAME="top" ID="top"></a> 22 <body><a NAME="top" ID="top"></a>
23 <h1>eric5.compileUiFiles</h1> 23 <h1>eric5.compileUiFiles</h1>
24 <p> 24 <p>
25 &#83;&#99;&#114;&#105;&#112;&#116; &#102;&#111;&#114; &#101;&#114;&#105;&#99;&#53; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#97;&#108;&#108; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#116;&#111; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101;. 25 Script for eric5 to compile all .ui files to Python source.
26 </p> 26 </p>
27 <h3>Global Attributes</h3> 27 <h3>Global Attributes</h3>
28 <table> 28 <table>
29 <tr><td>None</td></tr> 29 <tr><td>None</td></tr>
30 </table> 30 </table>
34 </table> 34 </table>
35 <h3>Functions</h3> 35 <h3>Functions</h3>
36 <table> 36 <table>
37 <tr> 37 <tr>
38 <td><a href="#compileUiDir">compileUiDir</a></td> 38 <td><a href="#compileUiDir">compileUiDir</a></td>
39 <td>&#67;&#114;&#101;&#97;&#116;&#101;&#115; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101;&#115; &#102;&#114;&#111;&#109; &#81;&#116; &#68;&#101;&#115;&#105;&#103;&#110;&#101;&#114; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#105;&#110; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#111;&#114; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101;.</td> 39 <td>Creates Python modules from Qt Designer .ui files in a directory or directory tree.</td>
40 </tr><tr> 40 </tr><tr>
41 <td><a href="#compileUiFiles">compileUiFiles</a></td> 41 <td><a href="#compileUiFiles">compileUiFiles</a></td>
42 <td>&#67;&#111;&#109;&#112;&#105;&#108;&#101; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#116;&#111; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101;&#115;.</td> 42 <td>Compile the .ui files to Python sources.</td>
43 </tr><tr> 43 </tr><tr>
44 <td><a href="#compile_ui">compile_ui</a></td> 44 <td><a href="#compile_ui">compile_ui</a></td>
45 <td>&#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#97; &#115;&#105;&#110;&#103;&#108;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;.</td> 45 <td>Local function to compile a single .ui file.</td>
46 </tr><tr> 46 </tr><tr>
47 <td><a href="#main">main</a></td> 47 <td><a href="#main">main</a></td>
48 <td>&#84;&#104;&#101; &#109;&#97;&#105;&#110; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#115;&#99;&#114;&#105;&#112;&#116;.</td> 48 <td>The main function of the script.</td>
49 </tr><tr> 49 </tr><tr>
50 <td><a href="#pyName">pyName</a></td> 50 <td><a href="#pyName">pyName</a></td>
51 <td>&#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#114;&#101;&#97;&#116;&#101; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101;&#100; .&#117;&#105; &#102;&#105;&#108;&#101;.</td> 51 <td>Local function to create the Python source file name for the compiled .ui file.</td>
52 </tr> 52 </tr>
53 </table> 53 </table>
54 <hr /><hr /> 54 <hr /><hr />
55 <a NAME="compileUiDir" ID="compileUiDir"></a> 55 <a NAME="compileUiDir" ID="compileUiDir"></a>
56 <h2>compileUiDir</h2> 56 <h2>compileUiDir</h2>
57 <b>compileUiDir</b>(<i>dir, recurse = False, map = None, **compileUi_args</i>) 57 <b>compileUiDir</b>(<i>dir, recurse = False, map = None, **compileUi_args</i>)
58 <p> 58 <p>
59 &#67;&#114;&#101;&#97;&#116;&#101;&#115; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101;&#115; &#102;&#114;&#111;&#109; &#81;&#116; &#68;&#101;&#115;&#105;&#103;&#110;&#101;&#114; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#105;&#110; &#97; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#111;&#114; 59 Creates Python modules from Qt Designer .ui files in a directory or
60 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#114;&#101;&#101;. 60 directory tree.
61 </p><p> 61 </p><p>
62 &#78;&#111;&#116;&#101;&#58; &#84;&#104;&#105;&#115; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#105;&#115; &#97; &#109;&#111;&#100;&#105;&#102;&#105;&#101;&#100; v&#101;&#114;&#115;&#105;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#111;&#110;&#101; &#102;&#111;&#117;&#110;&#100; &#105;&#110; &#80;y&#81;&#116;&#52;. 62 Note: This function is a modified version of the one found in PyQt4.
63 </p><dl> 63 </p><dl>
64 <dt><i>dir</i></dt> 64 <dt><i>dir</i></dt>
65 <dd> 65 <dd>
66 &#78;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#116;&#111; &#115;&#99;&#97;&#110; &#102;&#111;&#114; &#102;&#105;&#108;&#101;&#115; w&#104;&#111;&#115;&#101; &#110;&#97;&#109;&#101; &#101;&#110;&#100;&#115; w&#105;&#116;&#104; 66 Name of the directory to scan for files whose name ends with
67 '.&#117;&#105;'. &#66;y &#100;&#101;&#102;&#97;&#117;&#108;&#116; &#116;&#104;&#101; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101;&#100; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101; &#105;&#115; &#99;&#114;&#101;&#97;&#116;&#101;&#100; &#105;&#110; &#116;&#104;&#101; &#115;&#97;&#109;&#101; 67 '.ui'. By default the generated Python module is created in the same
68 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#101;&#110;&#100;&#105;&#110;&#103; w&#105;&#116;&#104; '.&#112;y'. 68 directory ending with '.py'.
69 </dd><dt><i>recurse</i></dt> 69 </dd><dt><i>recurse</i></dt>
70 <dd> 70 <dd>
71 &#102;&#108;&#97;&#103; &#105;&#110;&#100;&#105;&#99;&#97;&#116;&#105;&#110;&#103; &#116;&#104;&#97;&#116; &#97;&#110;y &#115;&#117;&#98;-&#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;&#105;&#101;&#115; &#115;&#104;&#111;&#117;&#108;&#100; &#98;&#101; &#115;&#99;&#97;&#110;&#110;&#101;&#100;. 71 flag indicating that any sub-directories should be scanned.
72 </dd><dt><i>map</i></dt> 72 </dd><dt><i>map</i></dt>
73 <dd> 73 <dd>
74 &#97;&#110; &#111;&#112;&#116;&#105;&#111;&#110;&#97;&#108; &#99;&#97;&#108;&#108;&#97;&#98;&#108;&#101; &#116;&#104;&#97;&#116; &#105;&#115; &#112;&#97;&#115;&#115;&#101;&#100; &#116;&#104;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y 74 an optional callable that is passed the name of the directory
75 &#99;&#111;&#110;&#116;&#97;&#105;&#110;&#105;&#110;&#103; &#116;&#104;&#101; '.&#117;&#105;' &#102;&#105;&#108;&#101; &#97;&#110;&#100; &#116;&#104;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101; &#116;&#104;&#97;&#116; w&#105;&#108;&#108; &#98;&#101; 75 containing the '.ui' file and the name of the Python module that will be
76 &#99;&#114;&#101;&#97;&#116;&#101;&#100;. &#84;&#104;&#101; &#99;&#97;&#108;&#108;&#97;&#98;&#108;&#101; &#115;&#104;&#111;&#117;&#108;&#100; &#114;&#101;&#116;&#117;&#114;&#110; &#97; &#116;&#117;&#112;&#108;&#101; &#111;&#102; &#116;&#104;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y 76 created. The callable should return a tuple of the name of the directory
77 &#105;&#110; w&#104;&#105;&#99;&#104; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101; w&#105;&#108;&#108; &#98;&#101; &#99;&#114;&#101;&#97;&#116;&#101;&#100; &#97;&#110;&#100; &#116;&#104;&#101; (&#112;&#111;&#115;&#115;&#105;&#98;&#108;y &#109;&#111;&#100;&#105;&#102;&#105;&#101;&#100;) 77 in which the Python module will be created and the (possibly modified)
78 &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#109;&#111;&#100;&#117;&#108;&#101;. 78 name of the module.
79 </dd><dt><i>compileUi_args</i></dt> 79 </dd><dt><i>compileUi_args</i></dt>
80 <dd> 80 <dd>
81 &#97;&#110;y &#97;&#100;&#100;&#105;&#116;&#105;&#111;&#110;&#97;&#108; &#107;&#101;yw&#111;&#114;&#100; &#97;&#114;&#103;&#117;&#109;&#101;&#110;&#116;&#115; &#116;&#104;&#97;&#116; &#97;&#114;&#101; &#112;&#97;&#115;&#115;&#101;&#100; &#116;&#111; 81 any additional keyword arguments that are passed to
82 &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101;&#85;&#105;() &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#104;&#97;&#116; &#105;&#115; &#99;&#97;&#108;&#108;&#101;&#100; &#116;&#111; &#99;&#114;&#101;&#97;&#116;&#101; &#101;&#97;&#99;&#104; &#80;y&#116;&#104;&#111;&#110; &#109;&#111;&#100;&#117;&#108;&#101;. 82 the compileUi() function that is called to create each Python module.
83 </dd> 83 </dd>
84 </dl> 84 </dl>
85 <div align="right"><a href="#top">Up</a></div> 85 <div align="right"><a href="#top">Up</a></div>
86 <hr /><hr /> 86 <hr /><hr />
87 <a NAME="compileUiFiles" ID="compileUiFiles"></a> 87 <a NAME="compileUiFiles" ID="compileUiFiles"></a>
88 <h2>compileUiFiles</h2> 88 <h2>compileUiFiles</h2>
89 <b>compileUiFiles</b>(<i></i>) 89 <b>compileUiFiles</b>(<i></i>)
90 <p> 90 <p>
91 &#67;&#111;&#109;&#112;&#105;&#108;&#101; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;&#115; &#116;&#111; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101;&#115;. 91 Compile the .ui files to Python sources.
92 </p> 92 </p>
93 <div align="right"><a href="#top">Up</a></div> 93 <div align="right"><a href="#top">Up</a></div>
94 <hr /><hr /> 94 <hr /><hr />
95 <a NAME="compile_ui" ID="compile_ui"></a> 95 <a NAME="compile_ui" ID="compile_ui"></a>
96 <h2>compile_ui</h2> 96 <h2>compile_ui</h2>
97 <b>compile_ui</b>(<i>ui_dir, ui_file</i>) 97 <b>compile_ui</b>(<i>ui_dir, ui_file</i>)
98 <p> 98 <p>
99 &#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#97; &#115;&#105;&#110;&#103;&#108;&#101; .&#117;&#105; &#102;&#105;&#108;&#101;. 99 Local function to compile a single .ui file.
100 </p><dl> 100 </p><dl>
101 <dt><i>ui_dir</i></dt> 101 <dt><i>ui_dir</i></dt>
102 <dd> 102 <dd>
103 &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#99;&#111;&#110;&#116;&#97;&#105;&#110;&#105;&#110;&#103; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 103 directory containing the .ui file (string)
104 </dd><dt><i>ui_file</i></dt> 104 </dd><dt><i>ui_file</i></dt>
105 <dd> 105 <dd>
106 &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; .&#117;&#105; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 106 file name of the .ui file (string)
107 </dd> 107 </dd>
108 </dl> 108 </dl>
109 <div align="right"><a href="#top">Up</a></div> 109 <div align="right"><a href="#top">Up</a></div>
110 <hr /><hr /> 110 <hr /><hr />
111 <a NAME="main" ID="main"></a> 111 <a NAME="main" ID="main"></a>
112 <h2>main</h2> 112 <h2>main</h2>
113 <b>main</b>(<i>argv</i>) 113 <b>main</b>(<i>argv</i>)
114 <p> 114 <p>
115 &#84;&#104;&#101; &#109;&#97;&#105;&#110; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#111;&#102; &#116;&#104;&#101; &#115;&#99;&#114;&#105;&#112;&#116;. 115 The main function of the script.
116 </p><dl> 116 </p><dl>
117 <dt><i>argv</i></dt> 117 <dt><i>argv</i></dt>
118 <dd> 118 <dd>
119 &#116;&#104;&#101; &#108;&#105;&#115;&#116; &#111;&#102; &#99;&#111;&#109;&#109;&#97;&#110;&#100; &#108;&#105;&#110;&#101; &#97;&#114;&#103;&#117;&#109;&#101;&#110;&#116;&#115;. 119 the list of command line arguments.
120 </dd> 120 </dd>
121 </dl> 121 </dl>
122 <div align="right"><a href="#top">Up</a></div> 122 <div align="right"><a href="#top">Up</a></div>
123 <hr /><hr /> 123 <hr /><hr />
124 <a NAME="pyName" ID="pyName"></a> 124 <a NAME="pyName" ID="pyName"></a>
125 <h2>pyName</h2> 125 <h2>pyName</h2>
126 <b>pyName</b>(<i>py_dir, py_file</i>) 126 <b>pyName</b>(<i>py_dir, py_file</i>)
127 <p> 127 <p>
128 &#76;&#111;&#99;&#97;&#108; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#116;&#111; &#99;&#114;&#101;&#97;&#116;&#101; &#116;&#104;&#101; &#80;y&#116;&#104;&#111;&#110; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101;&#100; .&#117;&#105; &#102;&#105;&#108;&#101;. 128 Local function to create the Python source file name for the compiled .ui file.
129 </p><dl> 129 </p><dl>
130 <dt><i>py_dir</i></dt> 130 <dt><i>py_dir</i></dt>
131 <dd> 131 <dd>
132 &#115;&#117;&#103;&#103;&#101;&#115;&#116;&#101;&#100; &#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y (&#115;&#116;&#114;&#105;&#110;&#103;) 132 suggested name of the directory (string)
133 </dd><dt><i>py_file</i></dt> 133 </dd><dt><i>py_file</i></dt>
134 <dd> 134 <dd>
135 &#115;&#117;&#103;&#103;&#101;&#115;&#116;&#101;&#100; &#110;&#97;&#109;&#101; &#102;&#111;&#114; &#116;&#104;&#101; &#99;&#111;&#109;&#112;&#105;&#108;&#101; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 135 suggested name for the compile source file (string)
136 </dd> 136 </dd>
137 </dl><dl> 137 </dl><dl>
138 <dt>Returns:</dt> 138 <dt>Returns:</dt>
139 <dd> 139 <dd>
140 &#116;&#117;&#112;&#108;&#101; &#111;&#102; &#100;&#105;&#114;&#101;&#99;&#116;&#111;&#114;y &#110;&#97;&#109;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) &#97;&#110;&#100; &#115;&#111;&#117;&#114;&#99;&#101; &#102;&#105;&#108;&#101; &#110;&#97;&#109;&#101; (&#115;&#116;&#114;&#105;&#110;&#103;) 140 tuple of directory name (string) and source file name (string)
141 </dd> 141 </dd>
142 </dl> 142 </dl>
143 <div align="right"><a href="#top">Up</a></div> 143 <div align="right"><a href="#top">Up</a></div>
144 <hr /> 144 <hr />
145 </body></html> 145 </body></html>

eric ide

mercurial