From 426cb870395b6380bc550d6c0815c62bb4683a0d Mon Sep 17 00:00:00 2001 From: undeath Date: Sun, 11 Nov 2018 19:03:47 +0100 Subject: [PATCH 1/2] fix loading of irc configuration --- jmclient/jmclient/configure.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jmclient/jmclient/configure.py b/jmclient/jmclient/configure.py index ff0cb5c..28101be 100644 --- a/jmclient/jmclient/configure.py +++ b/jmclient/jmclient/configure.py @@ -370,8 +370,16 @@ def donation_address(reusable_donation_pubkey=None): #pragma: no cover log.debug('sending coins to ' + sender_address) return sender_address, sign_k + +def remove_unwanted_default_settings(config): + for section in config.sections(): + if section.startswith('MESSAGING:'): + config.remove_section(section) + + def load_program_config(config_path=None, bs=None): global_singleton.config.readfp(io.BytesIO(defaultconfig)) + remove_unwanted_default_settings(global_singleton.config) if not config_path: config_path = os.getcwd() global_singleton.config_location = os.path.join( From 0d7a91ff6a8fb7ecfa7cd766808c8a116213c87c Mon Sep 17 00:00:00 2001 From: undeath Date: Sun, 11 Nov 2018 20:03:18 +0100 Subject: [PATCH 2/2] quit after creating a new config file --- jmclient/jmclient/configure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jmclient/jmclient/configure.py b/jmclient/jmclient/configure.py index 28101be..5c6d53f 100644 --- a/jmclient/jmclient/configure.py +++ b/jmclient/jmclient/configure.py @@ -394,6 +394,9 @@ def load_program_config(config_path=None, bs=None): if len(loadedFiles) != 1: with open(global_singleton.config_location, "w") as configfile: configfile.write(defaultconfig) + print("Created a new `joinmarket.cfg`. Please review and adopt the " + "settings and restart joinmarket.") + exit(1) #These are left as sanity checks but currently impossible #since any edits are overlays to the default, these sections/options will