2017-02-08 20:57:24 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
2017-02-08 20:58:11 +00:00
|
|
|
import configparser, os.path, getpass
|
2017-02-08 20:57:24 +00:00
|
|
|
|
|
|
|
if os.path.isfile("config.cfg"):
|
|
|
|
print("config.cfg already exists. Please remove it before running this script.")
|
|
|
|
exit(1)
|
|
|
|
|
|
|
|
config = configparser.RawConfigParser()
|
|
|
|
|
|
|
|
config.add_section("Romeo")
|
|
|
|
|
|
|
|
print('''In the next step, we'll get you connected to Read.it. For this, we
|
|
|
|
will need your username and password. Please note that these will be stored on
|
|
|
|
your hard disk in plain text. Sadly Read.it doesn't offer a better way for
|
|
|
|
third party applications to authenticate...
|
|
|
|
''')
|
|
|
|
|
|
|
|
unam = input("Username: ")
|
|
|
|
pwrd = getpass.getpass("Password (not echoed back!): ")
|
|
|
|
print()
|
|
|
|
|
|
|
|
config.set("Read.it", "user", unam)
|
|
|
|
config.set("Read.it", "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 the Read.it exporter. Have fun!")
|