コード例 #1
0
ファイル: run_tests.py プロジェクト: foaf/foaftown
 def testGenerateReport(self):
   """Use the template to generate our report page."""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri = FOAF)
   foaf_spec.index()
   page = VocabReport(foaf_spec, basedir='./examples/', temploc='template.html')
   tpl = page.template
   final = page.generate()
   rdfa = page.rdfa()
   self.assertNotEqual(final, "Nope!")
コード例 #2
0
 def testGenerateReport(self):
     """Use the template to generate our report page."""
     foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT, uri=FOAF)
     foaf_spec.index()
     page = VocabReport(foaf_spec,
                        basedir='./examples/',
                        temploc='template.html')
     tpl = page.template
     final = page.generate()
     rdfa = page.rdfa()
     self.assertNotEqual(final, "Nope!")
コード例 #3
0
ファイル: specgen6.py プロジェクト: smiy/specgen_working_dir
def makeSpec(indir, uri, shortName,outdir,outfile, template, templatedir,indexrdfdir, ontofile):
  spec = Vocab( indexrdfdir, ontofile, uri)
  spec.addShortName(shortName)
  spec.index() # slurp info from sources

  out = VocabReport( spec, indir, template, templatedir ) 

  filename = os.path.join(outdir, outfile)
  print "Printing to ",filename

  f = open(filename,"w")
  result = out.generate()
  f.write(result)
コード例 #4
0
ファイル: specgen6.py プロジェクト: zazi/specgen
def makeSpec(indir, uri, shortName, outdir, outfile, template, templatedir,
             indexrdfdir, ontofile):
    spec = Vocab(indexrdfdir, ontofile, uri)
    spec.addShortName(shortName)
    spec.index()  # slurp info from sources

    out = VocabReport(spec, indir, template, templatedir)

    filename = os.path.join(outdir, outfile)
    print "Printing to ", filename

    f = open(filename, "w")
    result = out.generate()
    f.write(result)
コード例 #5
0
ファイル: specgen6.py プロジェクト: monkeypants/specgen
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)
コード例 #6
0
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)