Lines 30-38
Link Here
|
30 |
# Redistribution and use is allowed according to the terms of the BSD license. |
30 |
# Redistribution and use is allowed according to the terms of the BSD license. |
31 |
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
31 |
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
32 |
|
32 |
|
33 |
import PyQt4.pyqtconfig |
33 |
try: |
|
|
34 |
import PyQt4.pyqtconfig |
35 |
pyqtcfg = PyQt4.pyqtconfig.Configuration() |
36 |
except ImportError: |
37 |
import PyQt4.QtCore |
38 |
import sipconfig # won't work for SIP v5 |
39 |
import os.path |
40 |
cfg = sipconfig.Configuration() |
41 |
sip_dir = cfg.default_sip_dir |
42 |
for p in (os.path.join(sip_dir, "PyQt4"), sip_dir): |
43 |
if os.path.exists(os.path.join(p, "QtCore", "QtCoremod.sip")): |
44 |
sip_dir = p |
45 |
break |
46 |
cfg = { |
47 |
'pyqt_version': PyQt4.QtCore.PYQT_VERSION, |
48 |
'pyqt_version_str': PyQt4.QtCore.PYQT_VERSION_STR, |
49 |
'pyqt_sip_flags': PyQt4.QtCore.PYQT_CONFIGURATION['sip_flags'], |
50 |
'pyqt_mod_dir': cfg.default_mod_dir, |
51 |
'pyqt_sip_dir': sip_dir, |
52 |
'pyqt_bin_dir': cfg.default_bin_dir, |
53 |
} |
54 |
pyqtcfg = sipconfig.Configuration([cfg]) |
34 |
|
55 |
|
35 |
pyqtcfg = PyQt4.pyqtconfig.Configuration() |
|
|
36 |
print("pyqt_version:%06.0x" % pyqtcfg.pyqt_version) |
56 |
print("pyqt_version:%06.0x" % pyqtcfg.pyqt_version) |
37 |
print("pyqt_version_num:%d" % pyqtcfg.pyqt_version) |
57 |
print("pyqt_version_num:%d" % pyqtcfg.pyqt_version) |
38 |
print("pyqt_version_str:%s" % pyqtcfg.pyqt_version_str) |
58 |
print("pyqt_version_str:%s" % pyqtcfg.pyqt_version_str) |