Skip to content

Commit efba7de

Browse files
committed
Added pyrcc5.exe and automatic generation of qt.conf
1 parent 8bdc6c2 commit efba7de

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

PyQt5/__init__.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,26 @@
3434

3535
qt_version_info = (5, 4, 0)
3636
qt_version = "%s.%s.%s" % qt_version_info
37-
__qt_version__ = qt_version
37+
__qt_version__ = qt_version
38+
39+
40+
def __createqtconf():
41+
"""Create a qt.conf file next to the current executable"""
42+
43+
template = """[Paths]
44+
Prefix = {path}
45+
Binaries = {path}
46+
"""
47+
48+
exedir = os.path.dirname(sys.executable)
49+
qtpath = os.path.join(exedir, "qt.conf")
50+
binpath = os.path.dirname(__file__).replace("\\", "/")
51+
52+
if not os.path.exists(qtpath):
53+
try:
54+
with open(qtpath, "w") as f:
55+
f.write(template.format(path=binpath))
56+
except Exception as e:
57+
sys.stderr.write("Could not write qt.conf: %s" % e)
58+
59+
__createqtconf()

PyQt5/pyrcc5.exe

55.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)