summaryrefslogtreecommitdiff
path: root/portato.py
diff options
context:
space:
mode:
authornecoro <>2007-07-21 22:13:06 +0000
committernecoro <>2007-07-21 22:13:06 +0000
commit44a726cd69e3e0d5c50890946b366c441a575a37 (patch)
tree26580405641d1f4f0e66acc859fad44ed3a54bef /portato.py
parent6d3b88dbe7a72377db9c853781593287f9cbcfa5 (diff)
downloadportato-44a726cd69e3e0d5c50890946b366c441a575a37.tar.gz
portato-44a726cd69e3e0d5c50890946b366c441a575a37.tar.bz2
portato-44a726cd69e3e0d5c50890946b366c441a575a37.zip
added logviewers
Diffstat (limited to 'portato.py')
-rwxr-xr-xportato.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/portato.py b/portato.py
index 5e8b30a..736d2f3 100755
--- a/portato.py
+++ b/portato.py
@@ -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()