mirror of
https://github.com/puppetlabs/infinitory.git
synced 2026-01-25 18:08:40 -05:00
Include static and templates in the built package
This commit is contained in:
parent
63f7d12371
commit
b96c7a17cf
13 changed files with 9 additions and 3 deletions
|
|
@ -1 +1,3 @@
|
|||
include README.rst
|
||||
graft infinitory/static
|
||||
graft infinitory/templates
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ def output_html(inventory, directory):
|
|||
if os.path.isdir(directory):
|
||||
shutil.rmtree(directory)
|
||||
os.mkdir(directory, 0o755)
|
||||
shutil.copytree("static", "{}/static".format(directory))
|
||||
|
||||
shutil.copytree(
|
||||
"{}/static".format(os.path.dirname(os.path.abspath(__file__))),
|
||||
"{}/static".format(directory))
|
||||
|
||||
with open("{}/pygments.css".format(directory), "w", encoding="utf-8") as css:
|
||||
css.write(pygments.formatters.HtmlFormatter().get_style_defs('.codehilite'))
|
||||
|
|
@ -126,8 +129,9 @@ def output_html(inventory, directory):
|
|||
|
||||
|
||||
def render_template(template_name, **kwargs):
|
||||
data_path = os.path.dirname(os.path.abspath(__file__))
|
||||
environment = jinja2.Environment(
|
||||
loader=jinja2.FileSystemLoader("templates"),
|
||||
loader=jinja2.FileSystemLoader("{}/templates".format(data_path)),
|
||||
autoescape=jinja2.select_autoescape(default=True))
|
||||
|
||||
md = markdown2.Markdown(extras=[
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -2,7 +2,7 @@ import setuptools
|
|||
|
||||
setuptools.setup(
|
||||
name = "infinitory",
|
||||
version = "0.0.1",
|
||||
version = "0.0.2",
|
||||
|
||||
description = "SRE host, role, and service inventory",
|
||||
author = "Daniel Parks",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue