diff options
author | necoro <> | 2007-07-21 22:13:06 +0000 |
---|---|---|
committer | necoro <> | 2007-07-21 22:13:06 +0000 |
commit | 44a726cd69e3e0d5c50890946b366c441a575a37 (patch) | |
tree | 26580405641d1f4f0e66acc859fad44ed3a54bef /portato.py | |
parent | 6d3b88dbe7a72377db9c853781593287f9cbcfa5 (diff) | |
download | portato-44a726cd69e3e0d5c50890946b366c441a575a37.tar.gz portato-44a726cd69e3e0d5c50890946b366c441a575a37.tar.bz2 portato-44a726cd69e3e0d5c50890946b366c441a575a37.zip |
added logviewers
Diffstat (limited to '')
-rwxr-xr-x | portato.py | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -67,12 +67,17 @@ def main (): show_ebuild(options.ebuild) elif options.validate: from lxml import etree - if etree.XMLSchema(file = XSD_LOCATION).validate(etree.parse(options.validate)): - print "Passed validation." - return - else: - print "Verification failed." + try: + etree.XMLSchema(file = XSD_LOCATION).assertValid(etree.parse(options.validate)) + except etree.XMLSyntaxError, e: + print "Verification failed. XML syntax error: %s." % e[0] + sys.exit(3) + except etree.DocumentInvalid: + print "Verification failed. Does not comply with schema." sys.exit(3) + else: + print "Verification succeeded." + return else: run() |