encapsulation: that kind of exception handling should be done in the gui module
This commit is contained in:
parent
299d54c6ec
commit
0d11aa75c4
26
electrum
26
electrum
|
@ -148,32 +148,10 @@ if __name__ == '__main__':
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import electrum.gui_qt as gui
|
import electrum.gui_qt as gui
|
||||||
elif options.gui == 'lite':
|
elif options.gui == 'lite':
|
||||||
# Let's do some dep checking and handle missing ones gracefully
|
|
||||||
try:
|
|
||||||
from PyQt4.QtCore import *
|
|
||||||
from PyQt4.QtGui import *
|
|
||||||
except ImportError:
|
|
||||||
print "You need to have PyQT installed to run Electrum in graphical mode."
|
|
||||||
print "If you have pip installed try 'sudo pip install pyqt' if you are on Debian/Ubuntu try 'sudo apt-get install python-qt4'."
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
qtVersion = qVersion()
|
|
||||||
if not(int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7):
|
|
||||||
app = QApplication(sys.argv)
|
|
||||||
QMessageBox.warning(None,"Could not start Lite GUI.", "Electrum was unable to load the 'Lite GUI' because it needs Qt version >= 4.7.\nElectrum is now setup to load the Pro GUI.")
|
|
||||||
|
|
||||||
simple_config.set_key("gui", "qt")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import lib.gui_qt as gui
|
import lib.gui_lite as gui
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import electrum.gui_qt as gui
|
import electrum.gui_lite as gui
|
||||||
else:
|
|
||||||
#use the lite version if no toolkit specified
|
|
||||||
try:
|
|
||||||
import lib.gui_lite as gui
|
|
||||||
except ImportError:
|
|
||||||
import electrum.gui_lite as gui
|
|
||||||
else:
|
else:
|
||||||
sys.exit("Error: Unknown GUI: " + options.gui)
|
sys.exit("Error: Unknown GUI: " + options.gui)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,25 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from PyQt4.QtCore import *
|
# Let's do some dep checking and handle missing ones gracefully
|
||||||
from PyQt4.QtGui import *
|
try:
|
||||||
|
from PyQt4.QtCore import *
|
||||||
|
from PyQt4.QtGui import *
|
||||||
|
except ImportError:
|
||||||
|
print "You need to have PyQT installed to run Electrum in graphical mode."
|
||||||
|
print "If you have pip installed try 'sudo pip install pyqt' if you are on Debian/Ubuntu try 'sudo apt-get install python-qt4'."
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
qtVersion = qVersion()
|
||||||
|
if not(int(qtVersion[0]) >= 4 and int(qtVersion[2]) >= 7):
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
QMessageBox.warning(None,"Could not start Lite GUI.", "Electrum was unable to load the 'Lite GUI' because it needs Qt version >= 4.7.\nElectrum was set to use the 'Qt' GUI")
|
||||||
|
from simple_config import SimpleConfig
|
||||||
|
cfg = SimpleConfig()
|
||||||
|
cfg.set_key("gui", "qt",True)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
from decimal import Decimal as D
|
from decimal import Decimal as D
|
||||||
from interface import DEFAULT_SERVERS
|
from interface import DEFAULT_SERVERS
|
||||||
|
|
Loading…
Reference in New Issue