Right check in module tr - right import order
This commit is contained in:
parent
533df80ce9
commit
d8be7cd19a
|
@ -1,6 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import shared
|
import state
|
||||||
|
|
||||||
# This is used so that the translateText function can be used when we are in daemon mode and not using any QT functions.
|
# This is used so that the translateText function can be used when we are in daemon mode and not using any QT functions.
|
||||||
class translateClass:
|
class translateClass:
|
||||||
|
@ -18,10 +18,10 @@ def _translate(context, text, disambiguation = None, encoding = None, n = None):
|
||||||
|
|
||||||
def translateText(context, text, n = None):
|
def translateText(context, text, n = None):
|
||||||
try:
|
try:
|
||||||
is_daemon = shared.thisapp.daemon
|
enableGUI = state.enableGUI
|
||||||
except AttributeError: # inside the plugin
|
except AttributeError: # inside the plugin
|
||||||
is_daemon = False
|
enableGUI = True
|
||||||
if not is_daemon:
|
if enableGUI:
|
||||||
try:
|
try:
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user