"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "python/utils.py" between
QGIS-final-3_14_15.tar.gz and QGIS-final-3_14_16.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Latest release (3.14.x series).

utils.py  (QGIS-final-3_14_15):utils.py  (QGIS-final-3_14_16)
skipping to change at line 680 skipping to change at line 680
def __enter__(self): def __enter__(self):
QApplication.setOverrideCursor(self.cursor) QApplication.setOverrideCursor(self.cursor)
def __exit__(self, exc_type, exc_val, exc_tb): def __exit__(self, exc_type, exc_val, exc_tb):
QApplication.restoreOverrideCursor() QApplication.restoreOverrideCursor()
####################### #######################
# IMPORT wrapper # IMPORT wrapper
if os.name == 'nt' and sys.version_info < (3, 8):
import ctypes
from ctypes import windll, wintypes
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
_hasAddDllDirectory = hasattr(kernel32, 'AddDllDirectory')
if _hasAddDllDirectory:
_import_path = os.environ['PATH']
_import_paths = {}
def _errcheck_zero(result, func, args):
if not result:
raise ctypes.WinError(ctypes.get_last_error())
return args
DLL_DIRECTORY_COOKIE = wintypes.LPVOID
_AddDllDirectory = kernel32.AddDllDirectory
_AddDllDirectory.errcheck = _errcheck_zero
_AddDllDirectory.restype = DLL_DIRECTORY_COOKIE
_AddDllDirectory.argtypes = (wintypes.LPCWSTR,)
_RemoveDllDirectory = kernel32.RemoveDllDirectory
_RemoveDllDirectory.errcheck = _errcheck_zero
_RemoveDllDirectory.argtypes = (DLL_DIRECTORY_COOKIE,)
_uses_builtins = True _uses_builtins = True
try: try:
import builtins import builtins
_builtin_import = builtins.__import__ _builtin_import = builtins.__import__
except AttributeError: except AttributeError:
_uses_builtins = False _uses_builtins = False
import __builtin__ import __builtin__
_builtin_import = __builtin__.__import__ _builtin_import = __builtin__.__import__
_plugin_modules = {} _plugin_modules = {}
skipping to change at line 704 skipping to change at line 731
certain unsafe imports certain unsafe imports
""" """
if level is None: if level is None:
level = 0 level = 0
if 'PyQt4' in name: if 'PyQt4' in name:
msg = 'PyQt4 classes cannot be imported in QGIS 3.x.\n' \ msg = 'PyQt4 classes cannot be imported in QGIS 3.x.\n' \
'Use {} or the version independent {} import instead.'.format(name .replace('PyQt4', 'PyQt5'), name.replace('PyQt4', 'qgis.PyQt')) 'Use {} or the version independent {} import instead.'.format(name .replace('PyQt4', 'PyQt5'), name.replace('PyQt4', 'qgis.PyQt'))
raise ImportError(msg) raise ImportError(msg)
if os.name == 'nt' and sys.version_info < (3, 8):
global _hasAddDllDirectory
if _hasAddDllDirectory:
global _import_path
global _import_paths
old_path = _import_path
new_path = os.environ['PATH']
if old_path != new_path:
global _AddDllDirectory
global _RemoveDllDirectory
for p in set(new_path.split(';')) - set(old_path.split(';')):
if p:
qDebug(u"AddDllDirectory:{}".format(p))
_import_paths[p] = _AddDllDirectory(p)
for p in set(old_path.split(';')) - set(new_path.split(';')):
if p in _import_paths:
qDebug(u"RemoveDllDirectory:{}".format(p))
_RemoveDllDirectory(_import_paths.pop(p))
_import_path = new_path
mod = _builtin_import(name, globals, locals, fromlist, level) mod = _builtin_import(name, globals, locals, fromlist, level)
if mod and '__file__' in mod.__dict__: if mod and '__file__' in mod.__dict__:
module_name = mod.__name__ if fromlist else name module_name = mod.__name__ if fromlist else name
package_name = module_name.split('.')[0] package_name = module_name.split('.')[0]
# check whether the module belongs to one of our plugins # check whether the module belongs to one of our plugins
if package_name in available_plugins: if package_name in available_plugins:
if package_name not in _plugin_modules: if package_name not in _plugin_modules:
_plugin_modules[package_name] = set() _plugin_modules[package_name] = set()
_plugin_modules[package_name].add(module_name) _plugin_modules[package_name].add(module_name)
 End of changes. 2 change blocks. 
0 lines changed or deleted 51 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)