Commit 77c04f12 authored by lambdamusic's avatar lambdamusic

capitalizations

parent 4992c95f
......@@ -221,8 +221,8 @@ def saveVizGithub(contents, ontouri):
DEPRECATED on 2016-11-16
Was working but had a dependecies on package 'uritemplate.py' which caused problems at installation time
"""
title = "OntoSpy: ontology export"
readme = """This ontology documentation was automatically generated with OntoSpy (https://github.com/lambdamusic/OntoSpy).
title = "Ontospy: ontology export"
readme = """This ontology documentation was automatically generated with Ontospy (https://github.com/lambdamusic/Ontospy).
The graph URI is: %s""" % str(ontouri)
files = {
'index.html': {
......@@ -235,7 +235,7 @@ def saveVizGithub(contents, ontouri):
'content':
"""The MIT License (MIT)
Copyright (c) 2016 OntoSpy project [http://lambdamusic.github.io/Ontospy//]
Copyright (c) 2016 Ontospy project [http://lambdamusic.github.io/Ontospy/]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -67,7 +67,7 @@
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy//">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy/">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -94,7 +94,7 @@
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -72,7 +72,7 @@ circle.child:hover {
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy//">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy/">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -92,7 +92,7 @@ circle.child:hover {
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -162,7 +162,7 @@ circle.child:hover {
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy//">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy/">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -182,7 +182,7 @@ circle.child:hover {
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -140,7 +140,7 @@ text {
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy//">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy/">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -160,7 +160,7 @@ text {
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -91,7 +91,7 @@ circle.child:hover {
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy//">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy/">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -111,7 +111,7 @@ circle.child:hover {
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -56,7 +56,7 @@
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy//">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="http://lambdamusic.github.io/Ontospy/">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -78,7 +78,7 @@
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -58,7 +58,7 @@
<h1 class="title">Ontology:&nbsp;<a href="javascript:showpanel('ontoinfo');">{{main_uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small class="credits">Ontology documentation automatically generated with <a class="greylink" href="http://lambdamusic.github.io/Ontospy//" target="_blank">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small class="credits">Ontology documentation automatically generated with <a class="greylink" href="http://lambdamusic.github.io/Ontospy/" target="_blank">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
......@@ -79,7 +79,7 @@
<hr>
<small class="credits">Documentation automatically generated with <a href="https://github.com/lambdamusic/OntoSpy" target="_blank" class="greylink">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small class="credits">Documentation automatically generated with <a href="https://github.com/lambdamusic/Ontospy" target="_blank" class="greylink">Ontospy</a> on {% now "jS F Y H:i" %}</small>
......
......@@ -166,7 +166,7 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">
<h1 class="title">{{ontology.uri}}</h1>
<h3>{{ontology.bestDescription}}</h3>
<h5>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</h5>
<h5>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</h5>
<hr>
......@@ -187,7 +187,7 @@ xmlns:dc="http://purl.org/dc/elements/1.1/">
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
<script type="text/javascript" src="{{STATIC_PATH}}d3.v2.min.js"></script>
......
......@@ -176,7 +176,7 @@ h6 { font: small-caps 100% sans-serif }
<h1 class="title">Graph:&nbsp;<a href="{{ontology.uri}}" target="_blank">{{ontology.uri}}</a></h1>
<h3>{{ontology.bestDescription}}</h3>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small></p>
<p><small>Ontology documentation automatically generated by <a class="greylink" href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small></p>
<hr>
......@@ -223,7 +223,7 @@ h6 { font: small-caps 100% sans-serif }
<hr>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/OntoSpy">OntoSpy</a> on {% now "jS F Y H:i" %}</small>
<small>Documentation automatically generated by <a href="https://github.com/lambdamusic/Ontospy">Ontospy</a> on {% now "jS F Y H:i" %}</small>
<script type="text/javascript" src="{{STATIC_PATH}}d3.v2.min.js"></script>
......
# !/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
ONTODOCS
Copyright (c) 2013-2017 __Michele Pasin__ <http://www.michelepasin.org>.
......@@ -24,13 +22,17 @@ from ..viz_html_multi import KompleteViz, KompleteVizMultiModel
from ..builder import random_theme
import webbrowser
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.command(context_settings=CONTEXT_SETTINGS)
@click.argument('source', nargs=-1)
@click.option('--outputpath', '-o', help='Output path (default: home folder).')
@click.option('--theme', help='CSS Theme for the html-complex visualization (random=use a random theme).')
@click.option('--outputpath', '-o', help='Output path (default: home folder).')
@click.option(
'--theme',
help=
'CSS Theme for the html-complex visualization (random=use a random theme).'
)
@click.option('--verbose', is_flag=True, help='Verbose mode.')
def cli_run_viz(source=None, outputpath="", theme="", verbose=False):
"""
......@@ -41,10 +43,11 @@ This application is a wrapper on the main ontospy-viz script. It generates docs
"""
if outputpath:
if not(os.path.exists(outputpath)) or not (os.path.isdir(outputpath)):
click.secho("WARNING: the -o option must include a valid directory path.", fg="red")
if not (os.path.exists(outputpath)) or not (os.path.isdir(outputpath)):
click.secho(
"WARNING: the -o option must include a valid directory path.",
fg="red")
sys.exit(0)
else:
from os.path import expanduser
......@@ -54,16 +57,23 @@ This application is a wrapper on the main ontospy-viz script. It generates docs
if source:
source_folder = source[0]
if not os.path.isdir(source_folder):
click.secho("WARNING: '%s' is not a valid directory path." % source_folder, fg="red")
click.secho(
"WARNING: '%s' is not a valid directory path." % source_folder,
fg="red")
sys.exit(0)
files_list = [f for f in os.listdir(source_folder) if os.path.isfile(os.path.join(source_folder, f))]
click.secho("Exporting the directory: '%s'" % source_folder, fg="green")
files_list = [
f for f in os.listdir(source_folder)
if os.path.isfile(os.path.join(source_folder, f))
]
click.secho(
"Exporting the directory: '%s'" % source_folder, fg="green")
click.secho("----------", fg="green")
else:
click.secho("Exporting the local library: '%s'" % get_home_location(), fg="green")
click.secho(
"Exporting the local library: '%s'" % get_home_location(),
fg="green")
click.secho("----------", fg="green")
files_list = get_localontologies()
source_folder = get_home_location()
......@@ -74,7 +84,7 @@ This application is a wrapper on the main ontospy-viz script. It generates docs
full_uri = os.path.join(source_folder, onto_name)
if theme:
if theme=="random":
if theme == "random":
_theme = random_theme()
else:
_theme = theme
......@@ -88,15 +98,21 @@ This application is a wrapper on the main ontospy-viz script. It generates docs
# if Ontospy graph has no valid 'sources' = file passed was not valid RDF
printDebug("Building visualization...", dim=True)
onto_name_safe = slugify(unicode(onto_name))
onto_outputpath = os.path.join(outputpath, onto_name_safe )
onto_outputpath = os.path.join(outputpath, onto_name_safe)
# note: single static files output path
static_outputpath = os.path.join(outputpath, "static" )
static_outputpath = os.path.join(outputpath, "static")
# v = KompleteViz(g, theme=_theme)
v = KompleteVizMultiModel(g, theme=_theme, static_url="../static/", output_path_static=static_outputpath)
v = KompleteVizMultiModel(
g,
theme=_theme,
static_url="../static/",
output_path_static=static_outputpath)
try:
# note: onto_outputpath is wiped out each time as part of the build
url = v.build(onto_outputpath)
report_pages.append("<a href='%s/index.html' target='_blank'>%s</a> ('%s' theme)<br />" % (onto_name_safe, onto_name, _theme))
report_pages.append(
"<a href='%s/index.html' target='_blank'>%s</a> ('%s' theme)<br />"
% (onto_name_safe, onto_name, _theme))
except:
e = sys.exc_info()[0]
printDebug("Error: " + str(e), "red")
......@@ -113,7 +129,7 @@ This application is a wrapper on the main ontospy-viz script. It generates docs
</style>
</head>
<body>
<h1>OntoSpy-generated documentation:</h1>
<h1>Ontospy-generated documentation:</h1>
%s
</body>
</html>
......@@ -126,11 +142,10 @@ This application is a wrapper on the main ontospy-viz script. It generates docs
raise SystemExit(1)
if __name__ == '__main__':
try:
# http://stackoverflow.com/questions/32553969/modify-usage-string-on-click-command-line-interface-on-windows
cli_run_viz(prog_name='ontospy-viz')
sys.exit(0)
except KeyboardInterrupt as e: # Ctrl-C
except KeyboardInterrupt as e: # Ctrl-C
raise e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment