From 751d38436e8ed6ef0145c76ac573e95fc1c9c6be Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Mon, 30 Mar 2020 16:18:47 +0530 Subject: [PATCH] chore: remove whitespaces from docstrings --- .../doctype/website_settings/google_indexing.py | 10 +++++----- .../doctype/website_settings/test_website_settings.py | 10 ---------- frappe/website/website_generator.py | 2 +- 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 frappe/website/doctype/website_settings/test_website_settings.py diff --git a/frappe/website/doctype/website_settings/google_indexing.py b/frappe/website/doctype/website_settings/google_indexing.py index ecf88438eb..d6db8541ef 100644 --- a/frappe/website/doctype/website_settings/google_indexing.py +++ b/frappe/website/doctype/website_settings/google_indexing.py @@ -19,7 +19,7 @@ SCOPES = "https://www.googleapis.com/auth/indexing" @frappe.whitelist() def authorize_access(reauthorize=None): - """ If no Authorization code get it from Google and then request for Refresh Token. """ + """If no Authorization code get it from Google and then request for Refresh Token.""" google_settings = frappe.get_doc("Google Settings") website_settings = frappe.get_doc("Website Settings") @@ -52,7 +52,7 @@ def authorize_access(reauthorize=None): def get_authentication_url(client_id, redirect_uri): - """ Return authentication url with the client id and redirect uri. """ + """Return authentication url with the client id and redirect uri.""" return { "url": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&response_type=code&prompt=consent&client_id={}&include_granted_scopes=true&scope={}&redirect_uri={}".format(client_id, SCOPES, redirect_uri) } @@ -60,7 +60,7 @@ def get_authentication_url(client_id, redirect_uri): @frappe.whitelist() def google_callback(code=None): - """ Authorization code is sent to callback as per the API configuration. """ + """Authorization code is sent to callback as per the API configuration.""" frappe.db.set_value("Website Settings", None, "indexing_authorization_code", code) frappe.db.commit() @@ -68,7 +68,7 @@ def google_callback(code=None): def get_google_indexing_object(): - """ Returns an object of Google Indexing object. """ + """Returns an object of Google Indexing object.""" google_settings = frappe.get_doc("Google Settings") account = frappe.get_doc("Website Settings") @@ -88,7 +88,7 @@ def get_google_indexing_object(): def publish_site(url, operation_type="URL_UPDATED"): - """ Send an update/remove url request. """ + """Send an update/remove url request.""" google_indexing = get_google_indexing_object() body = { diff --git a/frappe/website/doctype/website_settings/test_website_settings.py b/frappe/website/doctype/website_settings/test_website_settings.py deleted file mode 100644 index 9eca957713..0000000000 --- a/frappe/website/doctype/website_settings/test_website_settings.py +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2020, Frappe Technologies and Contributors -# See license.txt -from __future__ import unicode_literals - -# import frappe -import unittest - -class TestWebsiteSettings(unittest.TestCase): - pass diff --git a/frappe/website/website_generator.py b/frappe/website/website_generator.py index d6bdcf3ed0..1a32ef9ffa 100644 --- a/frappe/website/website_generator.py +++ b/frappe/website/website_generator.py @@ -122,7 +122,7 @@ class WebsiteGenerator(Document): return route def send_indexing_request(self, operation_type='URL_UPDATED'): - ''' Send indexing request on update/trash operation. ''' + """Send indexing request on update/trash operation.""" if frappe.db.get_single_value('Website Settings', 'enable_google_indexing') \ and self.is_website_published() and self.meta.allow_guest_to_view: