mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[db_manager] Fix postgis plugins loading
Fix infinite recursion on load calls
This commit is contained in:
parent
cfe8dfedae
commit
44731f2314
@ -21,17 +21,19 @@ email : brush.tyler@gmail.com
|
||||
"""
|
||||
|
||||
import os
|
||||
from importlib import import_module
|
||||
|
||||
current_dir = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def load(dbplugin, mainwindow):
|
||||
def load(db, mainwindow):
|
||||
for name in os.listdir(current_dir):
|
||||
if not os.path.isdir(os.path.join(current_dir, name)):
|
||||
continue
|
||||
if name in ('__pycache__'):
|
||||
continue
|
||||
try:
|
||||
exec(u"from .%s import load" % name)
|
||||
plugin_module = import_module('.'.join((__package__, name)))
|
||||
except ImportError:
|
||||
continue
|
||||
|
||||
load(dbplugin, mainwindow)
|
||||
plugin_module.load(db, mainwindow)
|
||||
|
Loading…
x
Reference in New Issue
Block a user