access to global configuration using set_config and get_config
This commit is contained in:
@@ -5,7 +5,7 @@ from wallet import Wallet, Wallet_2of2, Wallet_2of3, Imported_Wallet
|
||||
from verifier import TxVerifier
|
||||
from network import Network, DEFAULT_SERVERS, DEFAULT_PORTS, pick_random_server
|
||||
from interface import Interface
|
||||
from simple_config import SimpleConfig
|
||||
from simple_config import SimpleConfig, get_config, set_config
|
||||
import bitcoin
|
||||
import account
|
||||
import transaction
|
||||
|
||||
@@ -6,6 +6,15 @@ import os
|
||||
from util import user_dir, print_error, print_msg
|
||||
|
||||
|
||||
config = None
|
||||
def get_config():
|
||||
global config
|
||||
return config
|
||||
|
||||
def set_config(c):
|
||||
global config
|
||||
config = c
|
||||
|
||||
|
||||
class SimpleConfig:
|
||||
"""
|
||||
@@ -32,7 +41,7 @@ a SimpleConfig instance then reads the wallet file.
|
||||
self.user_config = {}
|
||||
self.read_user_config()
|
||||
|
||||
|
||||
set_config(self)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user