setup.py 679 B

123456789101112131415161718192021222324252627282930
  1. # GPL3 or later
  2. # This is a setup script.
  3. import os
  4. import json
  5. from modules.ui import *
  6. from getpass import getpass
  7. def run():
  8. try:
  9. with open('stuff.json') as json_file:
  10. stuff = json.load(json_file)
  11. except:
  12. stuff = {}
  13. center("Setting Up The Program")
  14. if "matrix" not in stuff:
  15. stuff["matrix"] = {}
  16. stuff["matrix"]["username"] = input("Matrix Bot's Username : ")
  17. stuff["matrix"]["password"] = getpass("Matrix Bot's Password : ")
  18. stuff["matrix"]["room"] = input("Matrix Music Room Name : ")
  19. with open('stuff.json', 'w') as fp:
  20. json.dump(stuff, fp, indent=4)
  21. center("Setup Is Finished!")