Skip to content

Commit

Permalink
Added script to build schema-all.html file without having to launch a…
Browse files Browse the repository at this point in the history
… local instance.
  • Loading branch information
Dataliberate committed Jul 16, 2019
1 parent df81637 commit 341cdcc
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions scripts/buildreleasespage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env python2.7
import unittest
import os
from os import path, getenv
from os.path import expanduser
import logging # https://docs.python.org/2/library/logging.html#logging-levels
import glob
import argparse
import sys
import csv
from time import gmtime, strftime

sys.path.append( os.getcwd() )
sys.path.insert( 1, 'lib' ) #Pickup libs, rdflib etc., from shipped lib directory
# Ensure that the google.appengine.* packages are available
# in tests as well as all bundled third-party packages.

sdk_path = getenv('APP_ENGINE', expanduser("~") + '/google-cloud-sdk/platform/google_appengine/')
sys.path.insert(0, sdk_path) # add AppEngine SDK to path

parser = argparse.ArgumentParser()
parser.add_argument("-o","--outputfile", required=True, help="output file")
args = parser.parse_args()
print "%s: Arguments: %s" % (sys.argv[0],args)
ofile = open(args.outputfile,'w')


import dev_appserver
dev_appserver.fix_sys_path()

from testharness import *
#Setup testharness state BEFORE importing sdo libraries
setInTestHarness(True)

from api import *
import rdflib
from rdflib import Graph
from rdflib.term import URIRef, Literal
from rdflib.parser import Parser
from rdflib.serializer import Serializer
from rdflib.plugins.sparql import prepareQuery
from rdflib.compare import graph_diff
from rdflib.namespace import RDFS, RDF
import threading

os.environ["WARMUPSTATE"] = "off"
from sdoapp import *
from sdoapp import SCHEMA_VERSION

page = ShowUnit().buildFullReleasePage('version/build-latest', SCHEMA_VERSION,'core')

print("Writing releases page to file %s" % args.outputfile)
ofile.write(page.encode('utf-8'))
ofile.close()

0 comments on commit 341cdcc

Please sign in to comment.