From a664dcf0fcaaee4c182f26d84b57ff285b5625f3 Mon Sep 17 00:00:00 2001 From: Andreas Savvides Date: Sun, 12 May 2013 17:19:22 +0100 Subject: [PATCH] Renaming access_key to api_key for consistency with mailjet docs --- mailjet/api.py | 4 ++-- mailjet/connection.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mailjet/api.py b/mailjet/api.py index f4ff9d8..274f0d3 100644 --- a/mailjet/api.py +++ b/mailjet/api.py @@ -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 diff --git a/mailjet/connection.py b/mailjet/connection.py index 400b2f3..2c87c2e 100644 --- a/mailjet/connection.py +++ b/mailjet/connection.py @@ -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 @@ -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 @@ -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)