Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Explicitly number replacement fields in a format string" issue #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bovadaAPI/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)



Expand Down
6 changes: 3 additions & 3 deletions bovadaAPI/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions bovadaAPI/bind_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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