from __future__ import print_function
import os
import sys
import argparse
import requests
import random
import json
from typtop.dbaccess import (
    UserTypoDB,
    call_check, is_user,
    get_time, get_machine_id
)
from typtop.config import (
    NUMBER_OF_ENTRIES_TO_ALLOW_TYPO_LOGIN,
    WARM_UP_CACHE, VERSION, DISTRO, BINDIR, first_msg,
    LOG_DIR, DB_NAME, TEST,
    SEC_DB_PATH)
from typtop.validate_parent import is_valid_parent
import subprocess

USER = ""
ALLOW_TYPO_LOGIN = True

# To deal with python3 mess
def _raw_input(prompt):
    if sys.version_info >= (3,):
        result = input(prompt)
    else:
        result = raw_input(prompt)
    return result

class AbortSettings(RuntimeError):
    pass


def _get_login_user():
    # gets the username of the logging user
    pp = subprocess.Popen('who', stdout=subprocess.PIPE)