From 5925a540ce9cec6b9df51567efc205470dfe56cb Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 2 Sep 2022 16:57:32 +0300 Subject: Replace format-strings with f-strings * wqflask/wqflask/db_info.py (InfoPage.get_info): Use f-strings. --- wqflask/wqflask/db_info.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/db_info.py b/wqflask/wqflask/db_info.py index 09cd614b..bd2f3b5e 100644 --- a/wqflask/wqflask/db_info.py +++ b/wqflask/wqflask/db_info.py @@ -39,15 +39,12 @@ class InfoPage: "LEFT JOIN DatasetStatus USING (DatasetStatusId) WHERE ") if self.gn_accession_id: - final_query = query_base + \ - "GN_AccesionId = {}".format(self.gn_accession_id) + final_query = f"{query_base}GN_AccesionId = {self.gn_accession_id}" results = g.db.execute(final_query).fetchone() if self.info_page_name and not results: - final_query = query_base + \ - "InfoPageName={}".format(self.info_page_name) + final_query = f"{query_base}InfoPageName = {self.info_page_name}" elif self.info_page_name: - final_query = query_base + \ - "InfoPageName={}".format(self.info_page_name) + final_query = f"{query_base}InfoPageName = {self.info_page_name}" results = g.db.execute(final_query).fetchone() else: raise 'No correct parameter found' @@ -56,8 +53,9 @@ class InfoPage: self.info = process_query_results(results) if (not results or len(results) < 1) and self.info_page_name and create: - insert_sql = "INSERT INTO InfoFiles SET InfoFiles.InfoPageName={}".format( - self.info_page_name) + insert_newlines = ( + "INSERT INTO InfoFiles SET " + f"InfoFiles.InfoPageName={self.info_page_name}") return self.get_info() if not self.gn_accession_id and self.info: -- cgit v1.2.3