add default config when both config.json and args not provided
This commit is contained in:
parent
710cd97094
commit
b01dbb0434
2 changed files with 14 additions and 2 deletions
|
@ -179,7 +179,13 @@ def main():
|
|||
with open(config_path, 'rb') as f:
|
||||
config = json.load(f)
|
||||
else:
|
||||
config = {}
|
||||
config = {"server": "127.0.0.1",
|
||||
"server_port": 8388,
|
||||
"local_port": 1080,
|
||||
"password": "barfoo!",
|
||||
"timeout": 600,
|
||||
"method": "table"
|
||||
}
|
||||
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:b:p:k:l:m:c:6')
|
||||
for key, value in optlist:
|
||||
|
|
|
@ -154,7 +154,13 @@ def main():
|
|||
config = json.load(f)
|
||||
logging.info('loading config from %s' % config_path)
|
||||
else:
|
||||
config = {}
|
||||
config = {"server": "127.0.0.1",
|
||||
"server_port": 8388,
|
||||
"local_port": 1080,
|
||||
"password": "barfoo!",
|
||||
"timeout": 600,
|
||||
"method": "table"
|
||||
}
|
||||
|
||||
optlist, args = getopt.getopt(sys.argv[1:], 's:p:k:m:c:6')
|
||||
for key, value in optlist:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue