-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.py
executable file
·62 lines (48 loc) · 1.62 KB
/
install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# Copyright (c) 2020-2023 Rich Bell <[email protected]>
#
# See the file LICENSE.txt for your full rights.
#
""" Installer for MTTQSubscribe driver and service. """
from io import StringIO
import configobj
from weecfg.extension import ExtensionInstaller
VERSION = '0.2.0'
HEALTHCHECKS_CONFIG = """
[StdReport]
[[Healthchecks]]
# Turn the service on and off.
# Default is: true
# Only used by the service.
enable = false
skin = healthchecks
# The host to 'ping'
# Default is hc-ping.com
# host = hc-ping.com
# The http request timeout
# The default is 10
# timeout = 10
# The HealthChecks uuid
uuid = REPLACE_ME
"""
def loader():
""" Load and return the extension installer. """
return HealthchecksInstaller()
class HealthchecksInstaller(ExtensionInstaller):
""" The extension installer. """
def __init__(self):
install_dict = {
'version': VERSION,
'name': 'Healthchecks',
'description': 'Monitor WeeWX using Healthchecks.io.',
'author': "Rich Bell",
'author_email': "[email protected]",
'files': [
('bin/user', ['bin/user/healthchecks.py']),
('skins/healthchecks',['skins/healthchecks/skin.conf']),
]
}
healthchecks_dict = configobj.ConfigObj(HEALTHCHECKS_CONFIG)
install_dict['config'] = healthchecks_dict
install_dict['prep_services'] = 'user.healthchecks.Healthchecks'
super().__init__(install_dict)