#!python

"""
Writes a "cfg_authkeys.py" config file containing item IDs of a new Eisenhower
Decision Matrix board on Trello in the YoDoIt module directory.

Run this script to assign the CLI to your Trello account.
"""

import os

def create_auth_file():
    auth_file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'yodoit'))
    f = open(os.path.join(auth_file_path, 'cfg_authkeys.py'), 'w')
    APP_KEY = raw_input("Enter your Trello app key: ")
    AUTH_TOKEN = raw_input("Enter your Trello auth token: ")
    authkeys = ("APP_KEY = \"%s\""
                "\nAUTH_TOKEN = \"%s\""
                % (APP_KEY, AUTH_TOKEN))
    f.write(authkeys)
    print "`cfg_authkeys.py` created."

create_auth_file()