def render_POST(self, request):
if 'disconnect' in request.args:
self._request_disconnection(request)
else:
# Save all the _inputdata, so it's the same next time
conn_params = {x: request.args[x][0] for x in request.args.keys()}
if request.args['secret_type'][0] == 'key':
conn_params['secret_key'] = 'checked'
conn_params['secret_password'] = ''
else:
conn_params['secret_key'] = ''
conn_params['secret_password'] = 'checked'
# Save both locally and across restarts
request.sdata.conn_params = conn_params
try:
with open(DEFAULT_PATH, 'wb') as f:
pickle.dump(conn_params, f)
except Exception as e:
print('### failed to save defaults: ' + str(e))
# Do the request
self._request_connection(request)
评论列表
文章目录