From afe31ac7c0ac37b2c024cd0f06b3013790d3dae6 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sun, 3 May 2020 19:31:20 +0530 Subject: [PATCH] style: Fix few deepsource issues --- frappe/core/doctype/translation/translation.py | 2 -- frappe/translate.py | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frappe/core/doctype/translation/translation.py b/frappe/core/doctype/translation/translation.py index 2af5d7f27f..177dea401f 100644 --- a/frappe/core/doctype/translation/translation.py +++ b/frappe/core/doctype/translation/translation.py @@ -6,7 +6,6 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils import strip_html_tags, is_html -from frappe.integrations.utils import make_post_request from frappe.translate import get_translator_url import json @@ -65,7 +64,6 @@ def create_translations(translation_map, language): doc.insert() translation_map_to_send[source_id].name = doc.name - params = { 'language': language, 'contributor_email': frappe.session.user, diff --git a/frappe/translate.py b/frappe/translate.py index a32450f243..70f96aad51 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -255,7 +255,7 @@ def get_user_translations(lang): key = translation.source_text value = translation.translated_text if translation.context: - key+= ':' + translation.context + key += ':' + translation.context out[key] = value frappe.cache().hset('lang_user_translations', lang, out) @@ -504,14 +504,14 @@ def get_messages_from_file(path): # To avoid duplicate scan if path in set(frappe.flags.scanned_files): return [] - else: - frappe.flags.scanned_files.append(path) + + frappe.flags.scanned_files.append(path) apps_path = get_bench_dir() if os.path.exists(path): with open(path, 'r') as sourcefile: - data = [(os.path.relpath(path, apps_path), - message, context, line) for line, message, context in extract_messages_from_code(sourcefile.read())] + data = [(os.path.relpath(path, apps_path), message, context, line) \ + for line, message, context in extract_messages_from_code(sourcefile.read())] return data else: # print "Translate: {0} missing".format(os.path.abspath(path))