diff options
author | necoro <> | 2007-07-20 07:19:27 +0000 |
---|---|---|
committer | necoro <> | 2007-07-20 07:19:27 +0000 |
commit | d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc (patch) | |
tree | 0441e1cec9d2881f939a017ba3e9ba2da9a2797e /portato.py | |
parent | 0a8d3b8add548efbc44a67c3eb1223ff94aaffc5 (diff) | |
download | portato-d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc.tar.gz portato-d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc.tar.bz2 portato-d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc.zip |
new Plugin Scheme
Diffstat (limited to '')
-rwxr-xr-x | portato.py | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -12,7 +12,7 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from portato.constants import VERSION, FRONTENDS, STD_FRONTEND +from portato.constants import VERSION, FRONTENDS, STD_FRONTEND, XSD_LOCATION from optparse import OptionParser import sys @@ -37,6 +37,9 @@ def main (): parser.add_option("-e", "--ebuild", action = "store", dest = "ebuild", help = "opens the ebuild viewer instead of launching Portato") + parser.add_option("-x", "--validate", action = "store", dest = "validate", metavar="PLUGIN", + help = "validates the given plugin xml instead of launching Portato") + # run parser (options, args) = parser.parse_args() @@ -62,6 +65,14 @@ def main (): if options.ebuild: 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." + sys.exit(3) else: run() |