From 8f45d48d719367d3d731396d623fcff7c20025a3 Mon Sep 17 00:00:00 2001 From: Tom Kent Date: Sat, 3 Oct 2020 07:58:00 -0500 Subject: [PATCH] Built into an extension Currently just package the whole directory (minus the .git) --- changelog | 0 install.py | 26 ++++++++++++++++++++++++++ readme.txt | 0 skins/JSON/skin.conf | 13 +++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 changelog create mode 100644 install.py create mode 100644 readme.txt create mode 100644 skins/JSON/skin.conf diff --git a/changelog b/changelog new file mode 100644 index 0000000..e69de29 diff --git a/install.py b/install.py new file mode 100644 index 0000000..d079d13 --- /dev/null +++ b/install.py @@ -0,0 +1,26 @@ +from setup import ExtensionInstaller + +def loader(): + return JSON_Installer() + +class JSON_Installer(ExtensionInstaller): + def __init__(self): + super(JSON_Installer, self).__init__( + version="1.0", + name='JSON', + description='Add JSON output', + author="Thomas Kent", + author_email="https://github.com/teeks99/weewx-json", + config={ + 'StdReport': { + 'JSONReport': { + 'skin': 'JSON', + 'enable': True + } + } + }, + files=[('skins/JSON', [ + 'skins/JSON/weewx.json.tmpl', + 'skins/JSON/skin.conf' + ])] + ) diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..e69de29 diff --git a/skins/JSON/skin.conf b/skins/JSON/skin.conf new file mode 100644 index 0000000..ce45bf9 --- /dev/null +++ b/skins/JSON/skin.conf @@ -0,0 +1,13 @@ +[CheetahGenerator] + # This section is used by the generator CheetahGenerator, and specifies + # which files are to be generated from which template. + + # Possible encodings are 'html_entities', 'utf8', or 'strict_ascii' + encoding = utf8 + + [[ToDate]] + template = weewx.json.tmpl + +[Generators] + # The list of generators that are to be run: + generator_list = weewx.cheetahgenerator.CheetahGenerator \ No newline at end of file