eric6/Utilities/uic.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 7229
53054eb5b15a
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2009 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a function to compile all user interface files of a
8 directory or directory tree.
9 """
10
11 from __future__ import unicode_literals
12
13 from PyQt5.uic import compileUiDir
14
15
16 def __pyName(py_dir, py_file):
17 """
18 Local function to create the Python source file name for the compiled
19 .ui file.
20
21 @param py_dir suggested name of the directory (string)
22 @param py_file suggested name for the compile source file (string)
23 @return tuple of directory name (string) and source file name (string)
24 """
25 return py_dir, "Ui_{0}".format(py_file)
26
27
28 def compileUiFiles(directory, recurse=False):
29 """
30 Module function to compile the .ui files of a directory tree to Python
31 sources.
32
33 @param directory name of a directory to scan for .ui files (string)
34 @param recurse flag indicating to recurse into subdirectories (boolean)
35 """
36 compileUiDir(directory, recurse, __pyName)

eric ide

mercurial