def makeSpec(indir, uri, shortName,outdir,outfile, template, templatedir, indexrdfdir, ontofile,specurl,name,addGroups): spec = Vocab( indexrdfdir, ontofile, uri) spec.addShortName(shortName) spec.index() # slurp info from sources #create a Report out = VocabReport( spec, indir, template, templatedir,specurl,name) #check template htmlgroups = None if (addGroups): if out.check_template_for_parameter('%groups%'): groups = Grouping(spec,uri) htmlgroups = groups.getHTMLGroups(); else: print "Template doesn't contain %groups% parameter -- skipping groups creation" filename = os.path.join(outdir, outfile) print "Printing to ",filename f = open(filename,"w") result = out.generate(htmlgroups) f.write(result)
def makeSpec(indir, uri, shortName, outdir, outfile, template, templatedir, indexrdfdir, ontofile, specurl, name, addGroups): spec = Vocab(indexrdfdir, ontofile, uri) spec.addShortName(shortName) spec.index() # slurp info from sources #create a Report out = VocabReport(spec, indir, template, templatedir, specurl, name) #check template htmlgroups = None if (addGroups): if out.check_template_for_parameter('%groups%'): groups = Grouping(spec, uri) htmlgroups = groups.getHTMLGroups() else: print "Template doesn't contain %groups% parameter -- skipping groups creation" filename = os.path.join(outdir, outfile) print "Printing to ", filename f = open(filename, "w") result = out.generate(htmlgroups) f.write(result)