Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 10, 2023
1 parent fab2d03 commit ed1d776
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions linkouts/linkouts/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

async def http_genes_get_handler(request):
# parse the query from the request query string
try :
ids = request.rel_url.query[GENES_QUERY]
except KeyError :
raise web.HTTPBadRequest(text="No "+GENES_QUERY+" supplied")
try:
ids = request.rel_url.query[GENES_QUERY]
except KeyError:
raise web.HTTPBadRequest(text="No " + GENES_QUERY + " supplied")
ids = ids.split(",")
handler = request.app["handler"]
linkouts = handler.process_genes(ids)
Expand All @@ -25,21 +25,21 @@ async def http_genes_post_handler(request):
data = await request.json()
ids = data.get(GENES_QUERY, [])
if type(ids) != list:
raise web.HTTPBadRequest(text=GENES_QUERY+" must be given as list")
raise web.HTTPBadRequest(text=GENES_QUERY + " must be given as list")
if len(ids) == 0:
raise web.HTTPBadRequest(text="No "+GENES_QUERY+" supplied")
raise web.HTTPBadRequest(text="No " + GENES_QUERY + " supplied")

handler = request.app["handler"]
linkouts = handler.process_genes(ids)
return web.json_response(linkouts)


async def http_genomic_regions_get_handler(request):
# parse the query from the request query string
try :
ids = request.rel_url.query[GENOMIC_REGIONS_QUERY]
except KeyError :
raise web.HTTPBadRequest(text="No "+GENOMIC_REGIONS_QUERY+" supplied")
try:
ids = request.rel_url.query[GENOMIC_REGIONS_QUERY]
except KeyError:
raise web.HTTPBadRequest(text="No " + GENOMIC_REGIONS_QUERY + " supplied")
ids = ids.split(",")
handler = request.app["handler"]
linkouts = handler.process_genomic_regions(ids)
Expand All @@ -51,9 +51,9 @@ async def http_genomic_regions_post_handler(request):
data = await request.json()
ids = data.get(GENOMIC_REGIONS_QUERY, [])
if type(ids) != list:
raise web.HTTPBadRequest(text=GENOMIC_REGIONS_QUERY+" must be given as list")
raise web.HTTPBadRequest(text=GENOMIC_REGIONS_QUERY + " must be given as list")
if len(ids) == 0:
raise web.HTTPBadRequest(text="No "+GENOMIC_REGIONS_QUERY+" supplied")
raise web.HTTPBadRequest(text="No " + GENOMIC_REGIONS_QUERY + " supplied")

handler = request.app["handler"]
linkouts = handler.process_genomic_regions(ids)
Expand Down

0 comments on commit ed1d776

Please sign in to comment.