From 4f70eaa01fc06fe8df87d210256043da6fac4fb5 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 2 Feb 2017 15:48:56 +0100 Subject: [PATCH] Fix curses mode --- src/bitmessagemain.py | 5 ++--- src/singleinstance.py | 3 +-- src/state.py | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index cd7205e8..ecc2c64e 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -160,9 +160,8 @@ class Main: shared.daemon = daemon # get curses flag - shared.curses = False if '-c' in sys.argv: - shared.curses = True + state.curses = True # is the application already running? If yes then exit. shared.thisapp = singleinstance("", daemon) @@ -241,7 +240,7 @@ class Main: upnpThread.start() if daemon == False and BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon') == False: - if shared.curses == False: + if state.curses == False: 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('You can also run PyBitmessage with the new curses interface by providing \'-c\' as a commandline argument.') diff --git a/src/singleinstance.py b/src/singleinstance.py index 1fd2ff20..a6ac4552 100644 --- a/src/singleinstance.py +++ b/src/singleinstance.py @@ -5,7 +5,6 @@ import errno from multiprocessing import Process import os import sys -import shared import state try: @@ -27,7 +26,7 @@ class singleinstance: self.lockPid = None 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. import bitmessageqt bitmessageqt.init() diff --git a/src/state.py b/src/state.py index 6ae563c4..05beab24 100644 --- a/src/state.py +++ b/src/state.py @@ -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. +curses = False + # If the trustedpeer option is specified in keys.dat then this will # contain a Peer which will be connected to instead of using the # addresses advertised by other peers. The client will only connect to