flake8: depends #1282

Merged
g1itch merged 5 commits from flake8-depends into v0.6 2018-06-27 11:24:56 +02:00
Showing only changes of commit 953ea4e950 - Show all commits

View File

@ -245,6 +245,19 @@ class Main:
state.enableGUI = False # run without a UI
# is the application already running? If yes then exit.
if state.enableGUI and not state.curses and not depends.check_pyqt():
sys.exit(
omkar1117 commented 2018-06-23 12:14:13 +02:00 (Migrated from github.com)
Review

Better write this kind of constant messages in a help folder and import them where required.

Better write this kind of constant messages in a help folder and import them where required.
g1itch commented 2018-06-23 12:35:12 +02:00 (Migrated from github.com)
Review

This message should stay along in this module I think, any other occurrences could be eliminated.

This message should stay along in this module I think, any other occurrences could be eliminated.
'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)
if daemon and not state.testmode:
@ -381,26 +394,14 @@ class Main:
BMConfigParser().remove_option('bitmessagesettings', 'dontconnect')
elif daemon is False:
if state.curses:
# if depends.check_curses():
if not depends.check_curses():
sys.exit()
print('Running with curses')
import bitmessagecurses
bitmessagecurses.runwrapper()
elif depends.check_pyqt():
else:
import bitmessageqt
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 state.testmode: