Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Renaming access_key to api_key for consistency with mailjet docs
  • Loading branch information
Andreas Savvides committed May 12, 2013
1 parent 9e2cb60 commit a664dcf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mailjet/api.py
Expand Up @@ -2,9 +2,9 @@
import json

class Api(object):
def __init__(self, connection=None, access_key=None, secret_key=None):
def __init__(self, connection=None, api_key=None, secret_key=None):
if not connection:
connection = Connection.get_connection(access_key, secret_key)
connection = Connection.get_connection(api_key, secret_key)

self.connection = connection

Expand Down
12 changes: 6 additions & 6 deletions mailjet/connection.py
Expand Up @@ -3,8 +3,8 @@
from mailjet.conf import settings

class Connection(object):
def __init__(self, access_key=None, secret_key=None, timeout=None):
self.access_key = access_key or settings.API_KEY
def __init__(self, api_key=None, secret_key=None, timeout=None):
self.api_key = api_key or settings.API_KEY
self.secret_key = secret_key or settings.SECRET_KEY
self.timeout = timeout or settings.TIMEOUT
self.opener = None
Expand All @@ -16,13 +16,13 @@ def get_opener(self, url):
password_mgr.add_password(
'Mailjet API',
settings.URL,
self.access_key,
self.api_key,
self.secret_key,
)
password_mgr.add_password(
'Provide an apiKey and secretKey',
settings.URL,
self.access_key,
self.api_key,
self.secret_key,
)
# Create a handler for this password manager
Expand Down Expand Up @@ -50,6 +50,6 @@ def open(self, method, function, options=None, postdata=None):
return opener.open(url, poststring, self.timeout)

@classmethod
def get_connection(cls, access_key, secret_key):
return Connection(access_key, secret_key)
def get_connection(cls, api_key, secret_key):
return Connection(api_key, secret_key)

0 comments on commit a664dcf

Please sign in to comment.