File tree 2 files changed +9
-5
lines changed
python/plugins/db_manager/db_plugins
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,9 @@ def quoteString(self, txt):
213
213
def getSchemaTableName (self , table ):
214
214
if not hasattr (table , '__iter__' ) and not isinstance (table , str ):
215
215
return (None , table )
216
- elif len (table ) < 2 :
216
+ if isinstance (table , str ):
217
+ table = table .split ('.' )
218
+ if len (table ) < 2 :
217
219
return (None , table [0 ])
218
220
else :
219
221
return (table [0 ], table [1 ])
Original file line number Diff line number Diff line change 21
21
"""
22
22
23
23
import os
24
+ from importlib import import_module
24
25
25
26
current_dir = os .path .dirname (__file__ )
26
27
27
28
28
- def load (dbplugin , mainwindow ):
29
+ def load (db , mainwindow ):
29
30
for name in os .listdir (current_dir ):
30
31
if not os .path .isdir (os .path .join (current_dir , name )):
31
32
continue
33
+ if name in ('__pycache__' ):
34
+ continue
32
35
try :
33
- exec ( u"from .%s import load" % name )
36
+ plugin_module = import_module ( '.' . join (( __package__ , name )) )
34
37
except ImportError :
35
38
continue
36
-
37
- load (dbplugin , mainwindow )
39
+ plugin_module .load (db , mainwindow )
You can’t perform that action at this time.
0 commit comments