matrix-music-bot

A matrix / synapse chatbot written in Python.
git clone git://johnkubach.com:/srv/git/matrix-music-bot
Log | Files | Refs | README

element.py (478B)


      1 from getpass import getpass
      2 
      3 try:
      4     get_input = raw_input
      5 except NameError:
      6     get_input = input
      7 
      8 
      9 def get_user_details(argv):
     10     try:
     11         host = argv[1]
     12     except IndexError:
     13         host = get_input("Host (ex: http://localhost:8008 ): ")
     14 
     15     try:
     16         username = argv[2]
     17     except IndexError:
     18         username = get_input("Username: ")
     19 
     20     try:
     21         password = argv[3]
     22     except IndexError:
     23         password = getpass()
     24 
     25     return host, username, password