Slightly rewritten bitmessagemain to use depends properly
This commit is contained in:
parent
9f8955ccdd
commit
953ea4e950
|
@ -245,6 +245,19 @@ class Main:
|
||||||
state.enableGUI = False # run without a UI
|
state.enableGUI = False # run without a UI
|
||||||
|
|
||||||
# is the application already running? If yes then exit.
|
# is the application already running? If yes then exit.
|
||||||
|
if state.enableGUI and not state.curses and not depends.check_pyqt():
|
||||||
|
sys.exit(
|
||||||
|
'PyBitmessage requires PyQt unless you want'
|
||||||
|
' to run it as a daemon and interact with it'
|
||||||
|
' using the API. You can download PyQt from '
|
||||||
|
'http://www.riverbankcomputing.com/software/pyqt/download'
|
||||||
|
' or by searching Google for \'PyQt Download\'.'
|
||||||
|
' If you want to run in daemon mode, see '
|
||||||
|
'https://bitmessage.org/wiki/Daemon\n'
|
||||||
|
'You can also run PyBitmessage with'
|
||||||
|
' the new curses interface by providing'
|
||||||
|
' \'-c\' as a commandline argument.'
|
||||||
|
)
|
||||||
shared.thisapp = singleinstance("", daemon)
|
shared.thisapp = singleinstance("", daemon)
|
||||||
|
|
||||||
if daemon and not state.testmode:
|
if daemon and not state.testmode:
|
||||||
|
@ -381,26 +394,14 @@ class Main:
|
||||||
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
|
||||||
elif daemon is False:
|
elif daemon is False:
|
||||||
if state.curses:
|
if state.curses:
|
||||||
# if depends.check_curses():
|
if not depends.check_curses():
|
||||||
|
sys.exit()
|
||||||
print('Running with curses')
|
print('Running with curses')
|
||||||
import bitmessagecurses
|
import bitmessagecurses
|
||||||
bitmessagecurses.runwrapper()
|
bitmessagecurses.runwrapper()
|
||||||
elif depends.check_pyqt():
|
else:
|
||||||
import bitmessageqt
|
import bitmessageqt
|
||||||
bitmessageqt.run()
|
bitmessageqt.run()
|
||||||
else:
|
|
||||||
sys.exit(
|
|
||||||
'PyBitmessage requires PyQt unless you want'
|
|
||||||
' to run it as a daemon and interact with it'
|
|
||||||
' using the API. You can download PyQt from '
|
|
||||||
'http://www.riverbankcomputing.com/software/pyqt/download'
|
|
||||||
' or by searching Google for \'PyQt Download\'.'
|
|
||||||
' If you want to run in daemon mode, see '
|
|
||||||
'https://bitmessage.org/wiki/Daemon\n'
|
|
||||||
'You can also run PyBitmessage with'
|
|
||||||
' the new curses interface by providing'
|
|
||||||
' \'-c\' as a commandline argument.'
|
|
||||||
)
|
|
||||||
|
|
||||||
if daemon:
|
if daemon:
|
||||||
if state.testmode:
|
if state.testmode:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user