aboutsummaryrefslogtreecommitdiff
path: root/wqflask/db
diff options
context:
space:
mode:
authorBonfaceKilz2021-04-30 12:26:19 +0300
committerBonfaceKilz2021-04-30 13:45:15 +0300
commit406eb27859cca232a562c722cbbd37aca2e3be84 (patch)
treeba3fba783e33cc56c535b68bd64d757bc6cde608 /wqflask/db
parentc7e661b8ff9f70955418fbc4527378904beb0cf4 (diff)
downloadgenenetwork2-406eb27859cca232a562c722cbbd37aca2e3be84.tar.gz
autopep8: Fix E301,E302,E303,E304,E305,E306
Diffstat (limited to 'wqflask/db')
-rw-r--r--wqflask/db/call.py4
-rw-r--r--wqflask/db/gn_server.py1
-rw-r--r--wqflask/db/webqtlDatabaseFunction.py1
3 files changed, 6 insertions, 0 deletions
diff --git a/wqflask/db/call.py b/wqflask/db/call.py
index 555878ad..9412b376 100644
--- a/wqflask/db/call.py
+++ b/wqflask/db/call.py
@@ -16,6 +16,7 @@ logger = getLogger(__name__)
# from inspect import stack
+
def fetch1(query, path=None, func=None):
"""Fetch one result as a Tuple using either a SQL query or the URI
path to GN_SERVER (when USE_GN_SERVER is True). Apply func to
@@ -35,6 +36,7 @@ GN_SERVER result when set (which should return a Tuple)
else:
return fetchone(query)
+
def fetchone(query):
"""Return tuple containing one row by calling SQL directly (the
original fetchone, but with logging)
@@ -46,6 +48,7 @@ original fetchone, but with logging)
return res.fetchone()
return logger.sql(query, helper)
+
def fetchall(query):
"""Return row iterator by calling SQL directly (the
original fetchall, but with logging)
@@ -57,6 +60,7 @@ original fetchall, but with logging)
return res.fetchall()
return logger.sql(query, helper)
+
def gn_server(path):
"""Return JSON record by calling GN_SERVER
diff --git a/wqflask/db/gn_server.py b/wqflask/db/gn_server.py
index 6c7383d0..f9b01658 100644
--- a/wqflask/db/gn_server.py
+++ b/wqflask/db/gn_server.py
@@ -5,5 +5,6 @@ from db.call import gn_server
from utility.logger import getLogger
logger = getLogger(__name__)
+
def menu_main():
return gn_server("/int/menu/main.json")
diff --git a/wqflask/db/webqtlDatabaseFunction.py b/wqflask/db/webqtlDatabaseFunction.py
index 18ade405..50ac06fd 100644
--- a/wqflask/db/webqtlDatabaseFunction.py
+++ b/wqflask/db/webqtlDatabaseFunction.py
@@ -31,6 +31,7 @@ logger = getLogger(__name__)
# function: connect to database and return cursor instance
###########################################################################
+
def retrieve_species(group):
"""Get the species of a group (e.g. returns string "mouse" on "BXD"