Merge branch 'SomberNight-setconfig_rpcpassword'
This commit is contained in:
3
electrum
3
electrum
@@ -278,7 +278,8 @@ def run_offline_command(config, config_options):
|
|||||||
# arguments passed to function
|
# arguments passed to function
|
||||||
args = [config.get(x) for x in cmd.params]
|
args = [config.get(x) for x in cmd.params]
|
||||||
# decode json arguments
|
# decode json arguments
|
||||||
args = list(map(json_decode, args))
|
if cmdname not in ('setconfig',):
|
||||||
|
args = list(map(json_decode, args))
|
||||||
# options
|
# options
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
for x in cmd.options:
|
for x in cmd.options:
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ class ElectrumGui:
|
|||||||
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
|
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
|
||||||
# ElectrumWindow], interval=5)])
|
# ElectrumWindow], interval=5)])
|
||||||
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
|
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
|
||||||
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
|
if hasattr(QtCore.Qt, "AA_ShareOpenGLContexts"):
|
||||||
|
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
|
||||||
self.config = config
|
self.config = config
|
||||||
self.daemon = daemon
|
self.daemon = daemon
|
||||||
self.plugins = plugins
|
self.plugins = plugins
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ from functools import wraps
|
|||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
from .import util
|
from .import util
|
||||||
from .util import bfh, bh2u, format_satoshis
|
from .util import bfh, bh2u, format_satoshis, json_decode
|
||||||
from .import bitcoin
|
from .import bitcoin
|
||||||
from .bitcoin import is_address, hash_160, COIN, TYPE_ADDRESS
|
from .bitcoin import is_address, hash_160, COIN, TYPE_ADDRESS
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
@@ -151,10 +151,8 @@ class Commands:
|
|||||||
@command('')
|
@command('')
|
||||||
def setconfig(self, key, value):
|
def setconfig(self, key, value):
|
||||||
"""Set a configuration variable. 'value' may be a string or a Python expression."""
|
"""Set a configuration variable. 'value' may be a string or a Python expression."""
|
||||||
try:
|
if key not in ('rpcuser', 'rpcpassword'):
|
||||||
value = ast.literal_eval(value)
|
value = json_decode(value)
|
||||||
except:
|
|
||||||
pass
|
|
||||||
self.config.set_key(key, value)
|
self.config.set_key(key, value)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user