electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit bd96815eb31f581e846a6f9072378219d90a4240
parent ba39f8bec059f861e15ac002c28581a1bbc44d20
Author: thomasv <thomasv@gitorious>
Date:   Mon, 17 Dec 2012 15:08:34 +0100

command line option for portable wallets

Diffstat:
Melectrum | 1+
Mlib/simple_config.py | 11++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/electrum b/electrum @@ -137,6 +137,7 @@ def arg_parser(): parser.add_option("-s", "--server", dest="server", default=None, help="set server host:port:protocol, where protocol is t or h") parser.add_option("-p", "--proxy", dest="proxy", default=None, help="set proxy [type:]host[:port], where type is socks4,socks5 or http") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="show debugging information") + parser.add_option("-P", "--portable", action="store_true", dest="portable", default=False, help="portable wallet") return parser diff --git a/lib/simple_config.py b/lib/simple_config.py @@ -17,12 +17,14 @@ a SimpleConfig instance then reads the wallet file. # system conf, readonly self.system_config = {} - self.read_system_config() + if options.get('portable') == False: + self.read_system_config() # user conf, writeable self.user_dir = user_dir() self.user_config = {} - self.read_user_config() + if options.get('portable') == False: + self.read_user_config() # command-line options self.options_config = options @@ -33,7 +35,10 @@ a SimpleConfig instance then reads the wallet file. print_error( "path", self.path ) if self.path: self.read_wallet_config(self.path) - + + # portable wallet: use the same directory for wallet and headers file + if options.get('portable'): + self.wallet_config['blockchain_headers_path'] = os.path.dirname(self.path)