sbtools/setup.py

32 lines
904 B
Python
Raw Normal View History

#!/usr/bin/env python3
2017-09-10 11:37:31 +00:00
import configparser, os.path, tweepy, getpass
if os.path.isfile("config.cfg"):
print("config.cfg already exists. Please remove it before running this script.")
exit(1)
config = configparser.RawConfigParser()
2017-09-09 12:40:28 +00:00
config.add_section("SB")
2017-09-10 11:37:31 +00:00
print('''In order to use SBTools, we'll get you connected to ScriptzBase. We
will need your username and password. Please note that these will be stored on
2017-09-09 12:40:28 +00:00
your hard disk in plain text. Sadly ScriptzBase doesn't offer a better way for
third party applications to authenticate...
''')
unam = input("Username: ")
pwrd = getpass.getpass("Password (not echoed back!): ")
print()
2017-09-09 12:40:28 +00:00
config.set("SB", "user", unam)
config.set("SB", "pass", pwrd)
print("Seems like everything worked out fine. Let's write that config file...")
with open('config.cfg', 'wt') as cfg:
config.write(cfg)
print("We're all done. You can now use Twitools. Have fun!")