request.toto_request

Here are the examples of the python api request.toto_request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

Example 1

Project: Toto
Source File: create.py
View license
def create_account(user_id, password):
  response = toto_request('account.create', {'user_id': user_id, 'password': password})
  if 'result' in response:
    with open('session.conf', 'wb') as session_file:
      session_file.write("session_id='%s'\n" % response['result']['session_id'])
      session_file.write("user_id='%s'\n" % response['result']['user_id'])
  return response

Example 2

Project: Toto
Source File: login.py
View license
def login(user_id, password):
  response = toto_request('account.login', {'user_id': user_id, 'password': password})
  if 'result' in response:
    with open('session.conf', 'wb') as session_file:
      session_file.write("session_id='%s'\n" % response['result']['session_id'])
      session_file.write("user_id='%s'\n" % response['result']['user_id'])
  return response

Example 3

Project: Toto
Source File: create.py
View license
def create_account(user_id, password):
  response = toto_request('account.create', {'user_id': user_id, 'password': password})
  if 'result' in response:
    with open('session.conf', 'wb') as session_file:
      session_file.write("session_id='%s'\n" % response['result']['session_id'])
      session_file.write("user_id='%s'\n" % response['result']['user_id'])
  return response

Example 4

Project: Toto
Source File: login.py
View license
def login(user_id, password):
  response = toto_request('account.login', {'user_id': user_id, 'password': password})
  if 'result' in response:
    with open('session.conf', 'wb') as session_file:
      session_file.write("session_id='%s'\n" % response['result']['session_id'])
      session_file.write("user_id='%s'\n" % response['result']['user_id'])
  return response