Esempio n. 1
0
def handle_base_profile(result, state):
    if result is None or len(result) == 0:
        Log.red("no result")
    elif len(result) > 1:
        Log.yellow("input the index to select one exact player (from 0..n)")
        table = PrettyTable(["name", "team", "index"])
        global SELECT_PLAYER
        SELECT_PLAYER = result
        global STATE
        STATE = state

        index = 0
        for obj in result:
            table.add_row([obj[2], obj[10], index])
            index = index + 1
        print table
    else:
        STATE = state
        handle_state(result[0])
        STATE = None
Esempio n. 2
0
def handle_base_profile(result, state):
    if result is None or len(result) == 0:
        Log.red("no result")
    elif len(result) > 1:
        Log.yellow("input the index to select one exact team (from 0..n)")
        table = PrettyTable(["name", "tricode", "conf", "index"])
        global SELECT_TEAMS
        SELECT_TEAMS = result
        global STATE
        STATE = state
        index = 0
        for obj in result:
            table.add_row([obj['fullName'], obj['tricode'], obj['confName'], index])
            index = index + 1
        print table
    else:
        global STATE
        STATE = state
        handle_state(result[0])
        STATE = None
Esempio n. 3
0
def help():
    Log.blue("  team info:")
    Log.yellow(
        "    \033[33minput\033[0m team name for team info. \033[7mE.g.\033[0m gsw or warriors"
    )
    Log.blue("  detail info:")
    Log.yellow(
        "    \033[33m-r \033[0m for team roster. \033[7mE.g.\033[0m gsw -r")
    Log.yellow(
        "      \033[0m  for 2014-15 season's roster. \033[7mE.g.\033[0m gsw -r 2014-15"
    )
    Log.yellow(
        "    \033[33m-s \033[0m for team stat. \033[7mE.g.\033[0m gsw -s")
    Log.yellow(
        "      \033[0m  for 2014-15 season's stat. \033[7mE.g.\033[0m gsw -s 2014-15"
    )
    Log.yellow(
        "    \033[33m-p \033[0m for team playoff stat. \033[7mE.g.\033[0m gsw -p"
    )
    Log.yellow(
        "      \033[0m  for 2014-15 season's playoff stat. \033[7mE.g.\033[0m gsw -p 2014-15"
    )

    Log.blue("  game info:")
    Log.yellow(
        "    \033[33m-l \033[0m for team game log. \033[7mE.g.\033[0m gsw -l")
    Log.yellow(
        "      \033[0m  for 2014-15 season's team game log. \033[7mE.g.\033[0m gsw -l 2014-15"
    )
    Log.yellow(
        "    \033[33m-lp\033[0m for team playoff game log. \033[7mE.g.\033[0m gsw -lp"
    )
    Log.yellow(
        "      \033[0m  for 2014-15 season's team playoff game log. \033[7mE.g.\033[0m gsw -lp 2014-15"
    )

    Log.red("  global:")
    Log.yellow(
        "    \033[33m-d\033[0m  for game detail stat,type gameid -d. \033[7mE.g.\033[0m 0041600405 -d"
    )

    Log.blue(
        "\n  FOR NBA STAT TERMS,LEARN FROM https://stats.nba.com/help/glossary/"
    )
Esempio n. 4
0
def help():
    Log.magenta("  player info:")

    Log.magenta(
        "    \033[33minput\033[0m player name for profile. \033[7mE.g.\033[0m lebron or lebron james"
    )
    Log.magenta(
        "    \033[33m-d\033[0m  for draft info. \033[7mE.g.\033[0m lebron -dr")
    Log.magenta(
        "    \033[33m-a\033[0m  for award info. \033[7mE.g.\033[0m lebron -a")
    Log.magenta(
        "    \033[33m-aa\033[0m for award detailed info. \033[7mE.g.\033[0m lebron -aa"
    )
    Log.magenta("  stat info:")

    Log.magenta(
        "    \033[33m-s\033[0m  for season stat. \033[7mE.g.\033[0m lebron -s or lebron james -s"
    )
    Log.magenta(
        "    \033[33m-sa\033[0m for season all detailed stat. \033[7mE.g.\033[0m lebron -sa"
    )
    Log.magenta(
        "    \033[33m-p\033[0m  for playoff stat. \033[7mE.g.\033[0m lebron -p"
    )
    Log.magenta(
        "    \033[33m-pa\033[0m for playoff all detailed stat. \033[7mE.g.\033[0m lebron -pa"
    )
    Log.magenta(
        "    \033[33m-ss\033[0m for senior season stat. \033[7mE.g.\033[0m lebron -ss"
    )
    Log.magenta(
        "    \033[33m-sp\033[0m for senior playoff stat. \033[7mE.g.\033[0m lebron -sp"
    )

    Log.magenta("  game log info:")
    Log.magenta(
        "    \033[33m-l\033[0m  for game log. \033[7mE.g.\033[0m lebron -l")
    Log.magenta(
        "    \033[33m  \033[0m  for 2014-15 season's game log. \033[7mE.g.\033[0m lebron -l 2014-15"
    )

    Log.magenta(
        "    \033[33m-lp\033[0m for playoff game log. \033[7mE.g.\033[0m lebron -lp"
    )
    Log.magenta(
        "    \033[33m   \033[0m for 2014-15 playoff's game log. \033[7mE.g.\033[0m lebron -lp 2014-15"
    )

    Log.magenta(
        "    \033[33m-la\033[0m for allstar game log. \033[7mE.g.\033[0m lebron -la"
    )
    Log.magenta(
        "    \033[33m   \033[0m for 2014-15 allstar's game log. \033[7mE.g.\033[0m lebron -la 2014-15"
    )
    Log.red("  global:")
    Log.yellow(
        "    \033[33m-d \033[0m for game detail stat,type gameid -d. \033[7mE.g.\033[0m 0041600405 -d"
    )

    Log.magenta(
        "\n  FOR NBA STAT TERMS,LEARN FROM https://stats.nba.com/help/glossary/"
    )