scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

python-sipcmd.py
Go to the documentation of this file.
1 
27 
28 
29 import os
30 import warnings
31 import sys, sipconfig
32 config = sipconfig.Configuration()
33 
34 try:
35  pyqt = sys.argv[1]
36 except IndexError:
37  pyqt = 'PyQt5'
38 
39 if (pyqt not in ['PyQt4','PyQt5']):
40  pyqt = 'PyQt5'
41 
42 try:
43  exec("from "+pyqt+".QtCore import PYQT_CONFIGURATION")
44 except ImportError:
45  pass
46 
47 sipBin = config.sip_bin
48 sipDir = config.default_sip_dir+'/'+pyqt
49 if not os.path.exists(sipDir):
50  if sys.version_info[0] >= 3 and sys.version_info[1] >= 8 and pyqt == 'PyQt5':
51  from importlib.metadata import distribution
52  dist = distribution(pyqt)
53  sip = [p for p in dist.files if p.name == 'QtCoremod.sip']
54  assert len(sip) == 1
55  sipDir = str(dist.locate_file(sip[0]).parent.parent)
56  else:
57  warnings.warn('sipDir does not exists, %s' % sipDir)
58 
59 sipFlags = PYQT_CONFIGURATION['sip_flags']
60 
61 flags = ["-I ../scidavis"]
62 if config.sip_version >= 0x040a00:
63  # make use of docstring generation feature in SIP >= 4.10
64  flags.append("-o")
65 
66 sys.stdout.write(" ".join([sipBin, '-I', sipDir, sipFlags]+flags))
str
#define str(x)
Definition: PythonScripting.cpp:41