mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
uic widget-plugins: do not crash if QGIS not installed
This commit is contained in:
parent
0ff49856e6
commit
acd574db2e
@ -23,27 +23,32 @@ in custom widgets to the correct QGIS python packages.
|
|||||||
It is copied on installation in /pythonX/dist-packages/PyQt4/uic/widget-plugins/
|
It is copied on installation in /pythonX/dist-packages/PyQt4/uic/widget-plugins/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#pluginType = CW_FILTER
|
# solution with CW_FILTER not fully working due to include of other files
|
||||||
#def getFilter():
|
# (e.g. for flags defined in other source files)
|
||||||
# import qgis.gui
|
|
||||||
#
|
|
||||||
# QGIS_widgets = {}
|
|
||||||
# for pyClass in dir(qgis.gui):
|
|
||||||
# QGIS_widgets[pyClass] = 'qgis.gui'
|
|
||||||
#
|
|
||||||
# def _QGISfilter(widgetname, baseclassname, module):
|
|
||||||
# print widgetname, baseclassname, module
|
|
||||||
# if widgetname in QGIS_widgets:
|
|
||||||
# return (MATCH, (widgetname, baseclassname, QGIS_widgets[widgetname]))
|
|
||||||
# else:
|
|
||||||
# return (NO_MATCH, None)
|
|
||||||
#
|
|
||||||
# return _QGISfilter
|
|
||||||
|
|
||||||
|
# pluginType = CW_FILTER
|
||||||
|
# def getFilter():
|
||||||
|
# import qgis.gui
|
||||||
|
#
|
||||||
|
# QGIS_widgets = {}
|
||||||
|
# for pyClass in dir(qgis.gui):
|
||||||
|
# QGIS_widgets[pyClass] = 'qgis.gui'
|
||||||
|
#
|
||||||
|
# def _QGISfilter(widgetname, baseclassname, module):
|
||||||
|
# print widgetname, baseclassname, module
|
||||||
|
# if widgetname in QGIS_widgets:
|
||||||
|
# return (MATCH, (widgetname, baseclassname, QGIS_widgets[widgetname]))
|
||||||
|
# else:
|
||||||
|
# return (NO_MATCH, None)
|
||||||
|
#
|
||||||
|
# return _QGISfilter
|
||||||
|
|
||||||
|
|
||||||
pluginType = MODULE
|
pluginType = MODULE
|
||||||
def moduleInformation():
|
def moduleInformation():
|
||||||
import qgis.gui
|
try:
|
||||||
return "qgis.gui", dir(qgis.gui)
|
import qgis.gui
|
||||||
|
return "qgis.gui", dir(qgis.gui)
|
||||||
|
except ImportError:
|
||||||
|
return "", []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user