<commit_before>import json
import ast
import threading
import os

from util import user_dir, print_error



class SimpleConfig:
    """
The SimpleConfig class is responsible for handling operations involving
configuration files.  The constructor reads and stores the system and 
user configurations from electrum.conf into separate dictionaries within
a SimpleConfig instance then reads the wallet file.
"""
    def __init__(self, options={}):
        self.lock = threading.Lock()

        # system conf, readonly
        self.system_config = {}
        if options.get('portable') is not True:
            self.read_system_config()

        # command-line options
        self.options_config = options

        # init path
        self.init_path()

        # user conf, writeable
        self.user_config = {}
        if options.get('portable') == False:
            self.read_user_config()





    def init_path(self):

        # Read electrum path in the command line configuration
        self.path = self.options_config.get('electrum_path')

        # Read electrum path in the system configuration<commit_msg>Fix for resetting options to default on program start when in portable mode.<commit_after>import json
import ast
import threading
import os

from util import user_dir, print_error



class SimpleConfig:
    """
The SimpleConfig class is responsible for handling operations involving
configuration files.  The constructor reads and stores the system and 
user configurations from electrum.conf into separate dictionaries within
a SimpleConfig instance then reads the wallet file.
"""
    def __init__(self, options={}):
        self.lock = threading.Lock()

        # system conf, readonly
        self.system_config = {}
        if options.get('portable') is not True:
            self.read_system_config()

        # command-line options
        self.options_config = options

        # init path
        self.init_path()

        # user conf, writeable
        self.user_config = {}
        self.read_user_config()





    def init_path(self):

        # Read electrum path in the command line configuration
        self.path = self.options_config.get('electrum_path')

        # Read electrum path in the system configuration
{'fraction_non_alphanumeric': 0.06729055258467023, 'fraction_numerical': 0.0, 'mean_word_length': 2.8115449915110355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6159966', 'n_tokens_mistral': 579, 'n_tokens_neox': 552, 'n_words': 206}