summaryrefslogtreecommitdiff
path: root/portato.py
diff options
context:
space:
mode:
authornecoro <>2007-07-20 07:19:27 +0000
committernecoro <>2007-07-20 07:19:27 +0000
commitd1a5c99708fa5e2fc0387e31ccb57f004d74f2fc (patch)
tree0441e1cec9d2881f939a017ba3e9ba2da9a2797e /portato.py
parent0a8d3b8add548efbc44a67c3eb1223ff94aaffc5 (diff)
downloadportato-d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc.tar.gz
portato-d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc.tar.bz2
portato-d1a5c99708fa5e2fc0387e31ccb57f004d74f2fc.zip
new Plugin Scheme
Diffstat (limited to 'portato.py')
-rwxr-xr-xportato.py13
1 files changed, 12 insertions, 1 deletions
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 <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()