Skip to content

Commit 64c12d5

Browse files
committed
refactor importing
1 parent 889925b commit 64c12d5

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

src/class_sqlThread.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,34 @@
3131
# from addresses import encodeAddress
3232

3333
try:
34-
import helper_sql, helper_startup, paths, queues, state, tr
34+
import helper_sql
3535
except ImportError:
36-
from . import helper_sql, helper_startup, paths, queues, state, tr
36+
from . import helper_sql
37+
38+
try:
39+
import helper_startup
40+
except ImportError:
41+
from . import helper_startup
42+
43+
try:
44+
import paths
45+
except ImportError:
46+
from . import paths
47+
48+
try:
49+
import queues
50+
except ImportError:
51+
from . import queues
52+
53+
try:
54+
import state
55+
except ImportError:
56+
from . import state
57+
58+
try:
59+
import tr
60+
except ImportError:
61+
from . import tr
3762

3863
try:
3964
from bmconfigparser import BMConfigParser
@@ -53,7 +78,6 @@
5378
# pylint: disable=attribute-defined-outside-init,protected-access
5479
root_path = os.path.dirname(os.path.dirname(__file__))
5580

56-
5781
def connection_build():
5882
conn = sqlite3.connect(state.appdata + 'messages.dat')
5983
conn.text_factory = str

0 commit comments

Comments
 (0)