# -*- coding: utf-8 -*-

import emoji
import os
import sys
import random
import getpass
import difflib
import subprocess
import webbrowser

import pkgtools.pypi as pp
import github
from travispy import TravisPy

from time import sleep
from cookiecutter.main import generate_context, generate_files

import keyring


import logging



GITHUB_NEW_TOKEN_URI = 'https://github.com/settings/tokens/new'

log = logging.getLogger(__name__)
log.setLevel(20)

def main(proposal=None, target_dir=None):
    """
    completly set-up a package in the target dir (using cookie cutter) 
        

    """
    if not target_dir:
        target_dir = os.getcwd()
        log.info('will use target dir', target_dir)

    token = keyring.get_password('session','github_token')

    if token is None:
        GITHUB_NEW_TOKEN_URI = 'https://github.com/settings/tokens/new'
        log.info(emoji.emojize(":heart_with_arrow: == LOVE == :heart_with_arrow:"))