Rewritten weird imports in class_sqlThread and fixed import from tr

This commit is contained in:
Dmitri Bogomolov 2021-05-27 15:44:05 +03:00
parent eb85efe3e5
commit 822f58ea5d
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -9,28 +9,22 @@ import sys
import threading import threading
import time import time
if sys.version_info[0] == 3: try:
from . import helper_sql
from . import helper_startup
from . import paths
from . import queues
from . import state
from . import tr
from .bmconfigparser import BMConfigParser
from .debug import logger
# pylint: disable=attribute-defined-outside-init,protected-access
from .addresses import encodeAddress
else:
import helper_sql import helper_sql
import helper_startup import helper_startup
import paths import paths
import queues import queues
import state import state
import tr from addresses import encodeAddress
from bmconfigparser import BMConfigParser from bmconfigparser import BMConfigParser
from debug import logger from debug import logger
# pylint: disable=attribute-defined-outside-init,protected-access from tr import _translate
from addresses import encodeAddress except ImportError:
from . import helper_sql, helper_startup, paths, queues, state
from .addresses import encodeAddress
from .bmconfigparser import BMConfigParser
from .debug import logger
from .tr import _translate
class sqlThread(threading.Thread): class sqlThread(threading.Thread):
@ -454,10 +448,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))
@ -484,10 +478,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))
@ -510,10 +504,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))
@ -535,10 +529,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))
@ -561,10 +555,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))
@ -588,10 +582,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))
@ -609,10 +603,10 @@ class sqlThread(threading.Thread):
' sqlThread will now exit.') ' sqlThread will now exit.')
queues.UISignalQueue.put(( queues.UISignalQueue.put((
'alert', ( 'alert', (
tr._translate( _translate(
"MainWindow", "MainWindow",
"Disk full"), "Disk full"),
tr._translate( _translate(
"MainWindow", "MainWindow",
'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'), 'Alert: Your disk or data storage volume is full. Bitmessage will now exit.'),
True))) True)))