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

"""Top-level package for elevate-osna."""

__author__ = """<NAME>, <NAME>, <NAME>"""
__email__ = '<EMAIL>, <EMAIL>, <EMAIL>'
__version__ = '0.1.0'

# -*- coding: utf-8 -*-
import os
import json


def write_default_credentials(path):
    cred_file = open(path, 'wt')
    creds = {
        "Twitter": {
            "consumer_key": "Az4GvKnMDywiT5CinddLkil23",
            "consumer_secret": "<KEY>",
            "access_token": "<KEY>",
            "access_token_secret": "<KEY>"
        },
        "IBM-Cloud": {
            "api_key": "<KEY>",
            "service_url": "https://gateway.watsonplatform.net/natural-language-understanding/api"
        }
    }
    json.dump(creds, cred_file)
    cred_file.close()


# Find OSNA_HOME path
if 'OSNA_HOME' in os.environ:
    osna_path = os.environ['OSNA_HOME']
else:
    osna_path = os.environ['HOME'] + os.path.sep + '.osna' + os.path.sep

# Make osna directory if not present
try:
    os.makedirs(osna_path)
except:
    pass

# twitter and ibm cloud credentials
credentials_path = osna_path + 'credentials.json'

if not os.path.isfile(credentials_path):
    write_default_credentials(credentials_path)

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

"""Top-level package for elevate-osna."""

__author__ = """<NAME>, <NAME>, <NAME>"""
__email__ = '<EMAIL>, <EMAIL>, <EMAIL>'
__version__ = '0.1.0'

# -*- coding: utf-8 -*-
import os
import json


def write_default_credentials(path):
    cred_file = open(path, 'wt')
    creds = {
        "Twitter": {
            "consumer_key": "Az4GvKnMDywiT5CinddLkil23",
            "consumer_secret": "<KEY>",
            "access_token": "<KEY>",
            "access_token_secret": "<KEY>"
        },
        "IBM-Cloud": {
            "api_key": "<KEY>",
            "service_url": "https://gateway.watsonplatform.net/natural-language-understanding/api"
        }
    }
    json.dump(creds, cred_file)
    cred_file.close()


# Find OSNA_HOME path
if 'OSNA_HOME' in os.environ:
    osna_path = os.environ['OSNA_HOME']
else:
    osna_path = os.environ['HOME'] + os.path.sep + '.osna' + os.path.sep

# Make osna directory if not present
try:
    os.makedirs(osna_path)
except:
    pass

# twitter and ibm cloud credentials
credentials_path = osna_path + 'credentials.json'

if not os.path.isfile(credentials_path):
    write_default_credentials(credentials_path)

# -*- coding: utf-8 -*- Top-level package for elevate-osna. <NAME>, <NAME>, <NAME> # -*- coding: utf-8 -*- # Find OSNA_HOME path # Make osna directory if not present # twitter and ibm cloud credentials