From a20769fb68fe48939f95bcb7eb0c2e78d2b46ae8 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 16 Dec 2018 16:19:21 -0600 Subject: [PATCH] config option for new api server --- onionr/onionr.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/onionr/onionr.py b/onionr/onionr.py index cf515819..ad6499e4 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -28,7 +28,7 @@ if sys.version_info[0] == 2 or sys.version_info[1] < 5: import os, base64, random, getpass, shutil, subprocess, requests, time, platform, datetime, re, json, getpass, sqlite3 import webbrowser from threading import Thread -import api, core, config, logger, onionrplugins as plugins, onionrevents as events +import api, apimanager, core, config, logger, onionrplugins as plugins, onionrevents as events import onionrutils from netcontroller import NetController from onionrblockapi import Block @@ -704,7 +704,12 @@ class Onionr: logger.debug('Runcheck file found on daemon start, deleting in advance.') os.remove('data/.runcheck') - apiThread = Thread(target = api.API, args = (self.debug, API_VERSION)) + apiTarget = api.API + if config.get('general.use_new_api_server', False): + apiTarget = apimanager.APIManager + apiThread = Thread(target = apiTarget, args = (self.onionrCore)) + else: + apiThread = Thread(target = apiTarget, args = (self.debug, API_VERSION)) apiThread.start() try: