Пример #1
0
def main():
    accepted_args = {
        "pids": get_pids,
        #"player_matches": get_player_matches,
        "all_pids": get_all_pids,
        "get_matches": get_matches,
        "get_all_matches": get_all_matches,
        "get_teams": get_teams,
        "get_all_teams": get_all_teams,
        "pmatches": get_pmatches,
        "all_pids": get_all_pids,
        "stats": get_all_stats,
        "pmatches_player": get_pmatches_player,
    }
    # Db config initialization
    conf = read_config()
    set_env_vars(conf)

    try:
        accepted_args[sys.argv[1]](sys.argv)
    except Exception as e:
        print("Invalid command or modifier")
        raise e
        return

    return
Пример #2
0
def dbInit():
    # Db config initialization
    conf = read_config()
    set_env_vars(conf)
Пример #3
0
        position = cursor.fetchall()[0]["position"]
        salary = cursor.fetchall()[0]["salary"]
        currPlayer = PlayerInput()
        currPlayer.setValues(cScore=cScore,
                             gScore=gScore,
                             pID=pID,
                             tID=tID,
                             position=position,
                             sal=salary,
                             dpos=dailyPosition)
        playerInputs.append(currPlayer)

    # for pi in playerInputs:
    #     print(pi.toString())

    return playerInputs, output


if __name__ == '__main__':
    # Db config initialization
    conf = read_config()
    set_env_vars(conf)
    #matchIDs = getmatchIDsValid()
    #for m in matchIDs:
    #    print(m)
    matches = ["46673", "46633", "46675"]
    #day = "2017-03-20"
    #matches = getMatchesOnDay(day)
    p_inputs, m_on_day = getPlayerScoresForMatches(matches)
    print(p_inputs)
    print(m_on_day)