Fix curses mode

This commit is contained in:
Peter Šurda 2017-02-02 15:48:56 +01:00
parent f3849eeb48
commit 4f70eaa01f
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
3 changed files with 5 additions and 5 deletions

View File

@ -160,9 +160,8 @@ class Main:
shared.daemon = daemon shared.daemon = daemon
# get curses flag # get curses flag
shared.curses = False
if '-c' in sys.argv: if '-c' in sys.argv:
shared.curses = True state.curses = True
# is the application already running? If yes then exit. # is the application already running? If yes then exit.
shared.thisapp = singleinstance("", daemon) shared.thisapp = singleinstance("", daemon)
@ -241,7 +240,7 @@ class Main:
upnpThread.start() upnpThread.start()
if daemon == False and BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') == False: if daemon == False and BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') == False:
if shared.curses == False: if state.curses == False:
if not depends.check_pyqt(): if not depends.check_pyqt():
print('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') print('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')
print('You can also run PyBitmessage with the new curses interface by providing \'-c\' as a commandline argument.') print('You can also run PyBitmessage with the new curses interface by providing \'-c\' as a commandline argument.')

View File

@ -5,7 +5,6 @@ import errno
from multiprocessing import Process from multiprocessing import Process
import os import os
import sys import sys
import shared
import state import state
try: try:
@ -27,7 +26,7 @@ class singleinstance:
self.lockPid = None self.lockPid = None
self.lockfile = os.path.normpath(os.path.join(state.appdata, 'singleton%s.lock' % flavor_id)) self.lockfile = os.path.normpath(os.path.join(state.appdata, 'singleton%s.lock' % flavor_id))
if not self.daemon and not shared.curses: if not self.daemon and not state.curses:
# Tells the already running (if any) application to get focus. # Tells the already running (if any) application to get focus.
import bitmessageqt import bitmessageqt
bitmessageqt.init() bitmessageqt.init()

View File

@ -17,6 +17,8 @@ appdata = '' #holds the location of the application data storage directory
shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof of work worker threads to exit. shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof of work worker threads to exit.
curses = False
# If the trustedpeer option is specified in keys.dat then this will # If the trustedpeer option is specified in keys.dat then this will
# contain a Peer which will be connected to instead of using the # contain a Peer which will be connected to instead of using the
# addresses advertised by other peers. The client will only connect to # addresses advertised by other peers. The client will only connect to