command line option for portable wallets

This commit is contained in:
thomasv 2012-12-17 15:08:34 +01:00
parent ba39f8bec0
commit bd96815eb3
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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)