forked from schemaorg/schemaorg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to build schema-all.html file without having to launch a…
… local instance.
- Loading branch information
1 parent
df81637
commit 341cdcc
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |