From df9ddb96dccbb59d8d76fed1e5249eb835adfdc2 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 11 Dec 2015 15:47:38 +0000 Subject: [PATCH] Explicitely numbered replacement fields --- bovadaAPI/Parser.py | 8 ++++---- bovadaAPI/api.py | 6 +++--- bovadaAPI/bind_api.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bovadaAPI/Parser.py b/bovadaAPI/Parser.py index 291f36d..a5b122b 100644 --- a/bovadaAPI/Parser.py +++ b/bovadaAPI/Parser.py @@ -41,7 +41,7 @@ def create_from_center_content(cls, content_center): away_team_short_name = search_dictionary_for_certain_keys("shortName", competitors[1]) away_team_abbreviation= search_dictionary_for_certain_keys("abbreviation", competitors[1]) away_team_full_name = search_dictionary_for_certain_keys("description", competitors[1]) - game_link = "https://sports.bovada.lv{}".format(match['link']) + game_link = "https://sports.bovada.lv{0}".format(match['link']) type_ = match['type'] displayGroups= match['displayGroups'] for group in displayGroups: @@ -145,7 +145,7 @@ def bulk_create_from_center_content(cls, center_content): except (KeyError, IndexError): pass try: - game_link = "https://sports.bovada.lv{}".format(match['link']) + game_link = "https://sports.bovada.lv{0}".format(match['link']) except (KeyError, TypeError): pass try: @@ -309,7 +309,7 @@ def parse_special_response(response, action): riskAmount = riskAmount outstanding_bet_amount += riskAmount - return "number of outstanding bets: {} outstanding_bet_amount: {}".format(len(items), outstanding_bet_amount) + return "number of outstanding bets: {0} outstanding_bet_amount: {1}".format(len(items), outstanding_bet_amount) elif action == "bet_history": total_profit = 0 @@ -339,7 +339,7 @@ def parse_special_response(response, action): ): number_of_bets_lost +=1 total_profit -= float(item["riskAmount"]) - return "total_profit: ${}, num_bets_won: {}:), number_of_bets_lost: {}:(".format(total_profit, number_of_bets_won, number_of_bets_lost) + return "total_profit: ${0}, num_bets_won: {1}:), number_of_bets_lost: {2}:(".format(total_profit, number_of_bets_won, number_of_bets_lost) diff --git a/bovadaAPI/api.py b/bovadaAPI/api.py index 5252510..7cdcdaf 100644 --- a/bovadaAPI/api.py +++ b/bovadaAPI/api.py @@ -149,11 +149,11 @@ def stream(): b = BovadaApi() b.auth - print "balance {}".format(b.balance) + print "balance {0}".format(b.balance) print "\n" - print "open_bets {}".format(b.open_bets) + print "open_bets {0}".format(b.open_bets) print "\n" - print "bet_history {}".format(b.bet_history) + print "bet_history {0}".format(b.bet_history) time.sleep(100) diff --git a/bovadaAPI/bind_api.py b/bovadaAPI/bind_api.py index d3091b4..041e4c6 100644 --- a/bovadaAPI/bind_api.py +++ b/bovadaAPI/bind_api.py @@ -142,7 +142,7 @@ def find_relative_urls(response, index=1, session=None): return all_urls def get_relative_url(endpoint, session): - URL = "https://sports.bovada.lv{}?json=true".format(endpoint) + URL = "https://sports.bovada.lv{0}?json=true".format(endpoint) try: response = session.get(URL, headers=get_bovada_headers_generic()) except Exception, e: @@ -191,7 +191,7 @@ def get_endpoint(action, profile_id): endpoint = "https://sports.bovada.lv/services/web/v2/profiles/%s/wagers?status=SETTLED&channel=ALL&days=14" %profile_id else: - raise BovadaException("did not receive a valid action. Received: {}".format(action)) + raise BovadaException("did not receive a valid action. Received: {0}".format(action)) return endpoint