Merge pull request #346 from methane/fix/config-priority
Prefer argumet to config
This commit is contained in:
@@ -597,11 +597,13 @@ class Connection(object):
|
||||
cfg = configparser.RawConfigParser()
|
||||
cfg.read(os.path.expanduser(read_default_file))
|
||||
|
||||
def _config(key, default):
|
||||
def _config(key, arg):
|
||||
if arg:
|
||||
return arg
|
||||
try:
|
||||
return cfg.get(read_default_group, key)
|
||||
except Exception:
|
||||
return default
|
||||
return arg
|
||||
|
||||
user = _config("user", user)
|
||||
password = _config("password", password)
|
||||
|
||||
Reference in New Issue
Block a user