Skip to content
Snippets Groups Projects
Commit c031d6c7 authored by Vermaat's avatar Vermaat
Browse files

Add checkSyntax to SOAP tools

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@468 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent 5896fe3b
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
"""
Run the Mutalyzer syntaxchecker on a variant description.
Usage:
{command} description
description: Variant description to check.
The syntaxchecker results are retrieved from the Mutalyzer SOAP webservice and
printed to standard output.
"""
from mutalyzer.util import monkey_patch_suds; monkey_patch_suds()
import sys
from suds.client import Client
from mutalyzer.util import format_usage
WSDL_LOCATION = 'http://localhost/mutalyzer/services/?wsdl'
def main(description):
"""
Run the Mutalyzer syntaxchecker and print results to standard output.
"""
service = Client(WSDL_LOCATION, cache=None).service
result = service.checkSyntax(description)
if result.valid:
print 'Syntax OK!'
else:
print 'Syntax NOT OK:'
for message in result.messages.SoapMessage:
print message.message
if __name__ == '__main__':
if len(sys.argv) < 2:
print format_usage()
sys.exit(1)
main(sys.argv[1])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment