From d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc Mon Sep 17 00:00:00 2001 From: necoro <> Date: Fri, 20 Jul 2007 07:19:27 +0000 Subject: new Plugin Scheme --- portato.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'portato.py') diff --git a/portato.py b/portato.py index e4210bb..5e8b30a 100755 --- a/portato.py +++ b/portato.py @@ -12,7 +12,7 @@ # # Written by René 'Necoro' Neumann -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() -- cgit v1.2.3