Skip to content

Commit 31f45ed

Browse files
author
Peter J. Freeman
authored
Merge branch 'master' into develop
2 parents 9287de2 + e70b496 commit 31f45ed

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

rest_VariantValidator/endpoints/lovd_endpoints.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Import modules
2+
import json
3+
import ast
24
from flask_restx import Namespace, Resource
35
from . import request_parser
46
from . import representations
@@ -9,6 +11,14 @@
911
import VariantValidator
1012
vval = VariantValidator.Validator()
1113

14+
15+
def ordereddict_to_dict(value):
16+
for k, v in value.items():
17+
if isinstance(v, dict):
18+
value[k] = ordereddict_to_dict(v)
19+
return dict(value)
20+
21+
1222
"""
1323
Create a parser object locally
1424
"""
@@ -69,6 +79,11 @@ def get(self, genome_build, variant_description, transcript_model, select_transc
6979
content = VariantFormatter.simpleVariantFormatter.format(variant_description, genome_build, transcript_model,
7080
select_transcripts, checkonly, liftover)
7181

82+
to_dict = ordereddict_to_dict(content)
83+
content = str(to_dict)
84+
content = content.replace("'", '"')
85+
content = ast.literal_eval(content)
86+
7287
# Collect Arguments
7388
args = parser.parse_args()
7489

@@ -78,7 +93,7 @@ def get(self, genome_build, variant_description, transcript_model, select_transc
7893
return representations.application_json(content, 200, None)
7994
# example: http://127.0.0.1:5000.....?content-type=application/xml
8095
elif args['content-type'] == 'application/xml':
81-
return representations.xml(content, 200, None)
96+
return representations.xml(str(content), 200, None)
8297
else:
8398
# Return the api default output
8499
return content

wsgi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"""mod_wsgi gateway wsgi file
1+
"""
2+
mod_wsgi gateway wsgi file
23
"""
34

45
from rest_VariantValidator.app import application as application
@@ -13,4 +14,4 @@
1314
else:
1415
application.debug = False
1516
application.config['PROPAGATE_EXCEPTIONS'] = False
16-
application.run(host="127.0.0.1", port=5000)
17+
application.run(host="127.0.0.1", port=8080)

0 commit comments

Comments
 (0)