From dc0e691108094d6d3e215f2e37e1191d3a617703 Mon Sep 17 00:00:00 2001 From: Hiranya Jayathilaka Date: Mon, 3 Apr 2017 12:16:19 -0700 Subject: [PATCH] Indenting multiline argument and exception details --- firebase_admin/__init__.py | 6 +++--- firebase_admin/auth.py | 10 ++++------ firebase_admin/credentials.py | 2 +- firebase_admin/jwt.py | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/firebase_admin/__init__.py b/firebase_admin/__init__.py index 601617b2..c7426481 100644 --- a/firebase_admin/__init__.py +++ b/firebase_admin/__init__.py @@ -27,7 +27,7 @@ def initialize_app(credential=None, options=None, name=_DEFAULT_APP_NAME): Args: credential: A credential object used to initialize the SDK (optional). If none is provided, - Google Application Default Credentials are used. + Google Application Default Credentials are used. options: A dictionary of configuration options (optional). name: Name of the app (optional). @@ -36,7 +36,7 @@ def initialize_app(credential=None, options=None, name=_DEFAULT_APP_NAME): Raises: ValueError: If the app name is already in use, or any of the - provided arguments are invalid. + provided arguments are invalid. """ if credential is None: credential = credentials.ApplicationDefault() @@ -100,7 +100,7 @@ def get_app(name=_DEFAULT_APP_NAME): Raises: ValueError: If the specified name is not a string, or if the specified - app does not exist. + app does not exist. """ if not isinstance(name, six.string_types): raise ValueError('Illegal app name argument type: "{}". App name ' diff --git a/firebase_admin/auth.py b/firebase_admin/auth.py index 0123a00e..1006bc2f 100644 --- a/firebase_admin/auth.py +++ b/firebase_admin/auth.py @@ -69,7 +69,7 @@ def create_custom_token(uid, developer_claims=None, app=None): Args: uid: ID of the user for whom the token is created. developer_claims: A dictionary of claims to be included in the token - (optional). + (optional). app: An App instance (optional). Returns: @@ -97,9 +97,8 @@ def verify_id_token(id_token, app=None): Raises: ValueError: If the input parameters are invalid, or if the App was not - initialized with a credentials.Certificate. - AppIdenityError: The JWT was found to be invalid, the message will contain - details. + initialized with a credentials.Certificate. + AppIdenityError: The JWT was found to be invalid, the message will contain details. """ token_generator = _get_token_generator(app) return token_generator.verify_id_token(id_token) @@ -199,8 +198,7 @@ def verify_id_token(self, id_token): Raises: ValueError: The app was not initialized with a credentials.Certificate instance. - AppIdenityError: The JWT was found to be invalid, the message will - contain details. + AppIdenityError: The JWT was found to be invalid, the message will contain details. """ if not id_token: raise ValueError('Illegal ID token provided: {0}. ID token must be a non-empty ' diff --git a/firebase_admin/credentials.py b/firebase_admin/credentials.py index 97cefb13..07591c7d 100644 --- a/firebase_admin/credentials.py +++ b/firebase_admin/credentials.py @@ -95,7 +95,7 @@ def __init__(self): Raises: oauth2client.client.ApplicationDefaultCredentialsError: If Application Default - credentials cannot be initialized in the current environment. + credentials cannot be initialized in the current environment. """ super(ApplicationDefault, self).__init__() self._g_credential = client.GoogleCredentials.get_application_default() diff --git a/firebase_admin/jwt.py b/firebase_admin/jwt.py index babd25cf..db419a4d 100644 --- a/firebase_admin/jwt.py +++ b/firebase_admin/jwt.py @@ -87,7 +87,7 @@ def decode(token): Returns: tuple: A 2-tuple where the first element is a dictionary of JWT headers, - and the second element is a dictionary of payload claims. + and the second element is a dictionary of payload claims. Raises: AppIdentityError: If the token is malformed or badly formatted