+ added powchoice.py to use old pow on windows, temporary fix for subprocess method not working there

* various bug fixes
This commit is contained in:
KF 2019-06-14 20:31:01 -05:00
parent f5b3406684
commit 5e73f83c57
9 changed files with 51 additions and 28 deletions

View file

@ -23,6 +23,11 @@ from threading import Thread
import onionr, api, logger, communicator
import onionrevents as events
from netcontroller import NetController
def _proper_shutdown(o_inst):
o_inst.onionrUtils.localCommand('shutdown')
sys.exit(1)
def daemon(o_inst):
'''
Starts the Onionr communication daemon
@ -39,8 +44,7 @@ def daemon(o_inst):
time.sleep(0)
except KeyboardInterrupt:
logger.debug('Got keyboard interrupt, shutting down...')
time.sleep(1)
o_inst.onionrUtils.localCommand('shutdown')
_proper_shutdown(o_inst)
apiHost = ''
while apiHost == '':
@ -64,7 +68,11 @@ def daemon(o_inst):
else:
logger.debug('.onion service disabled')
logger.debug('Using public key: %s' % (logger.colors.underline + o_inst.onionrCore._crypto.pubKey))
time.sleep(1)
try:
time.sleep(1)
except KeyboardInterrupt:
_proper_shutdown(o_inst)
o_inst.onionrCore.torPort = net.socksPort
communicatorThread = Thread(target=communicator.startCommunicator, args=(o_inst, str(net.socksPort)))

View file

@ -26,5 +26,5 @@ def open_home(o_inst):
logger.error('Onionr seems to not be running (could not get api host)')
else:
url = 'http://%s/#%s' % (url, o_inst.onionrCore.config.get('client.webpassword'))
print('If Onionr does not open automatically, use this URL:', url)
logger.info('If Onionr does not open automatically, use this URL:', url)
webbrowser.open_new_tab(url)