Skip to content

Commit

Permalink
Merge pull request #4434 from arnaud-morvan/db_manager_fix_schema_g
Browse files Browse the repository at this point in the history
Db manager fix schema g
  • Loading branch information
jef-n committed May 1, 2017
2 parents 2da64e4 + 44731f2 commit 1ed8880
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion python/plugins/db_manager/db_plugins/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ def quoteString(self, txt):
def getSchemaTableName(self, table):
if not hasattr(table, '__iter__') and not isinstance(table, str):
return (None, table)
elif len(table) < 2:
if isinstance(table, str):
table = table.split('.')
if len(table) < 2:
return (None, table[0])
else:
return (table[0], table[1])
Expand Down
10 changes: 6 additions & 4 deletions python/plugins/db_manager/db_plugins/postgis/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@
"""

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)

0 comments on commit 1ed8880

Please sign in to comment.