diff options
author | Munyoki Kilyungi | 2022-09-02 16:57:32 +0300 |
---|---|---|
committer | BonfaceKilz | 2022-09-08 14:26:19 +0300 |
commit | 5925a540ce9cec6b9df51567efc205470dfe56cb (patch) | |
tree | 1d8c81d19fc00ee0462bbe8a738786522e31dfec | |
parent | a12debe030b6b8c4ae30781ad20a9f4b043d5acc (diff) | |
download | genenetwork2-5925a540ce9cec6b9df51567efc205470dfe56cb.tar.gz |
Replace format-strings with f-strings
* wqflask/wqflask/db_info.py (InfoPage.get_info): Use f-strings.
-rw-r--r-- | wqflask/wqflask/db_info.py | 14 |
1 files changed, 6 insertions, 8 deletions
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: |