mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -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
|
import os
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
current_dir = os.path.dirname(__file__)
|
current_dir = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
|
||||||
def load(dbplugin, mainwindow):
|
def load(db, mainwindow):
|
||||||
for name in os.listdir(current_dir):
|
for name in os.listdir(current_dir):
|
||||||
if not os.path.isdir(os.path.join(current_dir, name)):
|
if not os.path.isdir(os.path.join(current_dir, name)):
|
||||||
continue
|
continue
|
||||||
|
if name in ('__pycache__'):
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
exec(u"from .%s import load" % name)
|
plugin_module = import_module('.'.join((__package__, name)))
|
||||||
except ImportError:
|
except ImportError:
|
||||||
continue
|
continue
|
||||||
|
plugin_module.load(db, mainwindow)
|
||||||
load(dbplugin, mainwindow)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user