mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
log python warnings and enabled deprecation warnings
This commit is contained in:
parent
595a45f4a9
commit
f2029b4ec4
@ -105,7 +105,7 @@ MACRO(ADD_SIP_PYTHON_MODULE MODULE_NAME MODULE_SIP)
|
||||
OUTPUT ${_sip_output_files}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo ${message}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${_sip_output_files}
|
||||
COMMAND ${SIP_BINARY_PATH} ${_sip_tags} -e ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip}
|
||||
COMMAND ${SIP_BINARY_PATH} ${_sip_tags} -w -e ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip}
|
||||
DEPENDS ${_abs_module_sip} ${SIP_EXTRA_FILES_DEPEND}
|
||||
)
|
||||
# not sure if type MODULE could be uses anywhere, limit to cygwin for now
|
||||
|
@ -28,8 +28,8 @@ QGIS utilities module
|
||||
|
||||
"""
|
||||
|
||||
from PyQt4.QtCore import QCoreApplication,QLocale, QString
|
||||
from qgis.core import QGis, QgsExpression
|
||||
from PyQt4.QtCore import QCoreApplication, QLocale, QString
|
||||
from qgis.core import QGis, QgsExpression, QgsMessageLog
|
||||
from string import Template
|
||||
import sys
|
||||
import traceback
|
||||
@ -37,10 +37,20 @@ import glob
|
||||
import os.path
|
||||
import re
|
||||
import ConfigParser
|
||||
import warnings
|
||||
|
||||
#######################
|
||||
# ERROR HANDLING
|
||||
|
||||
warnings.simplefilter('default')
|
||||
|
||||
def showWarning(message, category, filename, lineno, file=None, line=None):
|
||||
QgsMessageLog.logMessage(
|
||||
warnings.formatwarning(message, category, filename, lineno),
|
||||
QCoreApplication.translate( "Python", "Python" )
|
||||
)
|
||||
warnings.showwarning = showWarning
|
||||
|
||||
def showException(type, value, tb, msg):
|
||||
lst = traceback.format_exception(type, value, tb)
|
||||
if msg == None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user