def buildLibrary(planSchema): schema = xpjson.loadDocument(planSchema.schemaSource) library = xpjson.loadDocument(planSchema.librarySource, schema=schema, fillInDefaults=True) xpjson.dumpDocumentToPath(planSchema.simplifiedLibraryPath, library) print 'wrote simplified library for platform %s to %s' % (planSchema.platform, planSchema.simplifiedLibraryPath)
def buildLibrary(planSchema): schema = xpjson.loadDocument(planSchema.schemaSource) library = xpjson.loadDocument(planSchema.librarySource, schema=schema, fillInDefaults=True) xpjson.dumpDocumentToPath(planSchema.simplifiedLibraryPath, library) print 'wrote simplified library for platform %s to %s' % ( planSchema.platform, planSchema.simplifiedLibraryPath)
def buildSchema(planSchema): schema = xpjson.loadDocument(planSchema.schemaSource) xpjson.dumpDocumentToPath(planSchema.simplifiedSchemaPath, schema) print 'wrote simplified schema for platform %s to %s' % (planSchema.platform, planSchema.simplifiedSchemaPath)
% t) except: traceback.print_exc() print print 'INVALID %s' % docPath ###################################################################### elif cmd == 'simplify': if len(args) != 3: parser.error('simplify requires exactly 2 arguments') docPath = args[1] outPath = args[2] try: doc = xpjson.loadDocument(docPath, schema, fillInDefaults=True) xpjson.dumpDocumentToPath(outPath, doc) print 'wrote simplified %s to %s' % (doc.get('type'), outPath) except xpjson.NoSchemaError, t: parser.error( 'you must specify the --schema argument to validate a document of type %s' % t) except: traceback.print_exc() print print 'ERROR could not simplify %s' % docPath ###################################################################### elif cmd == 'import': if len(args) != 2: parser.error('import requires exactly 1 argument (import path)') importPath = args[1]
def buildSchema(planSchema): schema = xpjson.loadDocument(planSchema.schemaSource) xpjson.dumpDocumentToPath(planSchema.simplifiedSchemaPath, schema) print 'wrote simplified schema for platform %s to %s' % ( planSchema.platform, planSchema.simplifiedSchemaPath)
parser.error("you must specify the --schema argument to validate a document of type %s" % t) except: traceback.print_exc() print print "INVALID %s" % docPath ###################################################################### elif cmd == "simplify": if len(args) != 3: parser.error("simplify requires exactly 2 arguments") docPath = args[1] outPath = args[2] try: doc = xpjson.loadDocument(docPath, schema, fillInDefaults=True) xpjson.dumpDocumentToPath(outPath, doc) print "wrote simplified %s to %s" % (doc.get("type"), outPath) except xpjson.NoSchemaError, t: parser.error("you must specify the --schema argument to validate a document of type %s" % t) except: traceback.print_exc() print print "ERROR could not simplify %s" % docPath ###################################################################### elif cmd == "import": if len(args) != 2: parser.error("import requires exactly 1 argument (import path)") importPath = args[1] if not (opts.creator and opts.planNumber and opts.planVersion):