2014-05-02 11:42:37 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
***************************************************************************
|
|
|
|
customwidgets.py
|
|
|
|
---------------------
|
|
|
|
Date : May 2014
|
|
|
|
Copyright : (C) 2014 by Denis Rouzaud
|
|
|
|
Email : denis.rouzaud@gmail.com
|
|
|
|
***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************
|
|
|
|
"""
|
|
|
|
|
2014-05-12 17:03:12 +02:00
|
|
|
"""
|
|
|
|
This file is used by pyuic to redirect includes
|
|
|
|
in custom widgets to the correct QGIS python packages.
|
2017-06-27 10:43:14 +02:00
|
|
|
It is copied on installation in /pythonX/dist-packages/PyQt5/uic/widget-plugins/
|
2014-05-12 17:03:12 +02:00
|
|
|
"""
|
|
|
|
|
2014-05-19 16:03:07 +02:00
|
|
|
# solution with CW_FILTER not fully working due to include of other files
|
|
|
|
# (e.g. for flags defined in other source files)
|
2014-05-02 11:42:37 +02:00
|
|
|
|
2014-05-19 16:03:07 +02:00
|
|
|
# pluginType = CW_FILTER
|
|
|
|
# def getFilter():
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
# import qgis.gui
|
2014-05-21 21:25:18 +02:00
|
|
|
#
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
# QGIS_widgets = {}
|
|
|
|
# for pyClass in dir(qgis.gui):
|
|
|
|
# QGIS_widgets[pyClass] = 'qgis.gui'
|
2014-05-21 21:25:18 +02:00
|
|
|
#
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
# 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)
|
2014-05-21 21:25:18 +02:00
|
|
|
#
|
fix python pep8 warnings and fix some revealed errors
pep8 --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701 \
--exclude="ui_*.py,debian/*,python/ext-libs/*" \
.
2015-02-01 14:15:42 +01:00
|
|
|
# return _QGISfilter
|
2014-05-02 11:42:37 +02:00
|
|
|
|
2014-05-12 17:03:12 +02:00
|
|
|
|
|
|
|
pluginType = MODULE
|
2015-08-22 14:29:41 +02:00
|
|
|
|
|
|
|
|
2014-05-07 16:41:59 +02:00
|
|
|
def moduleInformation():
|
2016-01-30 09:33:24 +11:00
|
|
|
try:
|
|
|
|
import qgis.gui
|
2017-07-24 11:36:38 +02:00
|
|
|
widget_list = dir(qgis.gui)
|
2017-07-24 10:45:32 +02:00
|
|
|
widget_list.remove('QgsScrollArea')
|
|
|
|
return "qgis.gui", widget_list
|
2016-01-30 09:33:24 +11:00
|
|
|
except ImportError:
|
|
|
|
return "", []
|