Files
weewx/examples/basic/install.py
Tom Keffer fe9eb512a8 Moved things back to their v4 locations.
make target `pypi-packages` copies them back into `wee_resources`
before invoking `poetry build`
2023-02-26 13:52:09 -08:00

50 lines
1.5 KiB
Python

# installer for the 'basic' skin
# Copyright 2014-2021 Matthew Wall
from weecfg.extension import ExtensionInstaller
def loader():
return BasicInstaller()
class BasicInstaller(ExtensionInstaller):
def __init__(self):
super(BasicInstaller, self).__init__(
version="0.4",
name='Basic',
description='Very basic skin for weewx.',
author="Matthew Wall",
author_email="mwall@users.sourceforge.net",
config={
'StdReport': {
'BasicReport': {
'skin': 'basic',
'enable' : 'True',
'HTML_ROOT': 'basic',
'lang': 'en',
'unit_system': 'US'
}
}
},
files=[
('skins/basic',
['skins/basic/basic.css',
'skins/basic/current.inc',
'skins/basic/favicon.ico',
'skins/basic/hilo.inc',
'skins/basic/index.html.tmpl',
'skins/basic/skin.conf',
'skins/basic/lang/en.conf',
'skins/basic/lang/fr.conf',
]),
]
)
def configure(self, engine):
"""Customized configuration that sets a language code"""
# TODO: Set a units code as well
code = engine.get_lang_code('basic', 'en')
self['config']['StdReport']['BasicReport']['lang'] = code
return True