Repository navigation
Expand file tree
/
Copy pathinstall.py
More file actions
261 lines (236 loc) · 12 KB
/
Copy pathinstall.py
File metadata and controls
261 lines (236 loc) · 12 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# Installer for Belchertown weewx skin
# Pat O'Brien, 2018
import sys
from io import StringIO
import configobj
import weewx
from setup import ExtensionInstaller
#-------- extension info -----------
VERSION = "3.0.0"
NAME = 'Belchertown'
DESCRIPTION = 'A clean modern skin with real time streaming updates and interactive charts. Modeled after BelchertownWeather.com'
AUTHOR = "Pat OBrien"
AUTHOR_EMAIL = "https://github.com/poblabs/weewx-belchertown"
#-------- main loader -----------
def loader():
# Belchertown 3 needs weewx 5; older weewx stays on Belchertown 1.3.1.
if int(weewx.__version__.split(".")[0]) < 5:
sys.exit("Belchertown 3 requires weewx 5.0 or newer (found weewx %s). "
"On older weewx, install Belchertown 1.3.1."
% weewx.__version__)
return BelchertownInstaller()
class BelchertownInstaller(ExtensionInstaller):
def __init__(self):
super(BelchertownInstaller, self).__init__(
version=VERSION,
name=NAME,
description=DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
config=config_dict,
files=files_dict
)
#----------------------------------
# config stanza
#----------------------------------
extension_config = """
[StdReport]
[[Belchertown]]
skin = Belchertown
HTML_ROOT = belchertown
enable = true
[[[Extras]]]
# For help refer to the docs at https://github.com/poblabs/weewx-belchertown
# and consult skin.conf for the configurable elements and their hierarchy
#--- General Options ---
# belchertown_debug = 0
# belchertown_locale = "auto"
# theme = light
# theme_toggle_enabled = 1
# logo_image = ""
# logo_image_dark = ""
# site_title = "My Weather Website"
# station_observations = "barometer","dewpoint","outHumidity","rainWithRainRate"
# beaufort_category = 0
# manifest_name = "My Weather Website"
# manifest_short_name = "MWW"
# radar_html = '' # (default seems to center on your lat/lon)
# radar_html_dark = None
# radar_zoom = 8
# radar_marker = 0
# almanac_extras = 1
# highcharts_enabled = 1
# graph_page_show_all_button = 1
# graph_page_default_graphgroup = "day"
# highcharts_homepage_graphgroup = "day"
# highcharts_decimal = "auto"
# highcharts_thousands = "auto"
# googleAnalyticsId = ""
# webpage_autorefresh = 0
# reload_hook_images = 0
# reload_images_radar = 300
# reload_images_hook_asi = -1
# reload_images_hook_af = -1
# reload_images_hook_as = -1
# reload_images_hook_ac = -1
# show_last_updated_alert = 0
# last_updated_alert_threshold = 1800
#--- MQTT Websockets (for Real Time Streaming) Options ---
# mqtt_websockets_enabled = 0
# mqtt_websockets_host = ""
# mqtt_websockets_port = 8080
# mqtt_websockets_ssl = 0
# mqtt_websockets_topic = ""
# disconnect_live_website_visitor = 1800000
#--- Forecast Options ---
# forecast_enabled = 1
# forecast_provider = "auto" # auto, openmeteo, nws or aeris (Xweather)
# forecast_api_id = ""
# forecast_api_secret = ""
# forecast_units = "us"
# forecast_lang = "en"
# forecast_stale = 3540
# forecast_aeris_use_metar = 1
# forecast_interval_hours = 24
# forecast_alert_enabled = 1
# forecast_alert_provider = "auto" # auto, nws, aeris (Xweather) or none
# forecast_alert_limit = 1
# forecast_show_daily_forecast_link = 0
# forecast_daily_forecast_link = ""
# aqi_enabled = 0
# aqi_location_enabled = 0
#--- Earthquake Options ---
# earthquake_enabled = 0
# earthquake_maxradiuskm = 1000
# earthquake_stale = 10740
# earthquake_server = USGS
# geonet_mmi = 4
#--- Social Options ---
# facebook_enabled = 0
# social_share_html = ""
#--- Kiosk view (?view=kiosk) MQTT broker, if different ---
# mqtt_websockets_host_kiosk = ""
# mqtt_websockets_port_kiosk = ""
# mqtt_websockets_ssl_kiosk = ""
#-------------------------------------------------------------
#---
#--- python's ConfigObj has a limitation in how it processes
#--- comments, so we need to define an 'unused' variable below
#--- to ensure that this whole stanza makes it into weewx.conf
#---
#--- please ignore the following 'unused' variable
#---
#-------------------------------------------------------------
work_around_ConfigObj_limitations = true
# [[[[Generic]]]]
#-- Footer information --
# footer_copyright_text = "My Weather Website"
# footer_disclaimer_text = "Never make important decisions based on info from this website."
#-- Default page headers --
# home_page_header = "My Station Weather Conditions"
# graphs_page_header = "Weather Observation Graphs"
# reports_page_header = "Weather Observation Reports"
# records_page_header = "Weather Observation Records"
# about_page_header = "About This Site"
# powered_by = 'Observations are powered by a <a href="/about" target="_blank">Personal Weather Station</a>'
"""
config_dict = configobj.ConfigObj(StringIO(extension_config))
#----------------------------------
# files stanza
#----------------------------------
files=[('bin/user', ['bin/user/belchertown.py', 'bin/user/belchertown_forecast.py'
]
),
('skins/Belchertown', ['skins/Belchertown/favicon.ico',
'skins/Belchertown/footer.html.tmpl',
'skins/Belchertown/header.html.tmpl',
'skins/Belchertown/index.html.tmpl',
'skins/Belchertown/about.inc.example',
'skins/Belchertown/celestial.inc',
'skins/Belchertown/graphs.conf.example',
'skins/Belchertown/page-header.inc',
'skins/Belchertown/manifest.json.tmpl',
'skins/Belchertown/index_radar.inc.example',
'skins/Belchertown/records.inc.example',
'skins/Belchertown/records-table.inc.example',
'skins/Belchertown/robots.txt',
'skins/Belchertown/skin.conf',
'skins/Belchertown/style.css'
]
),
('skins/Belchertown/about', ['skins/Belchertown/about/index.html.tmpl']),
('skins/Belchertown/home', ['skins/Belchertown/home/charts.inc',
'skins/Belchertown/home/conditions.inc',
'skins/Belchertown/home/forecast.inc',
'skins/Belchertown/home/onthisday.inc',
'skins/Belchertown/home/snapshot.inc'
]
),
('skins/Belchertown/lang', ['skins/Belchertown/lang/ca.conf',
'skins/Belchertown/lang/de.conf',
'skins/Belchertown/lang/fr.conf',
'skins/Belchertown/lang/it.conf'
]
),
('skins/Belchertown/graphs', ['skins/Belchertown/graphs/index.html.tmpl']),
('skins/Belchertown/NOAA', ['skins/Belchertown/NOAA/NOAA-YYYY-MM.txt.tmpl',
'skins/Belchertown/NOAA/NOAA-YYYY.txt.tmpl'
]
),
('skins/Belchertown/records', ['skins/Belchertown/records/index.html.tmpl']),
('skins/Belchertown/reports', ['skins/Belchertown/reports/index.html.tmpl']),
('skins/Belchertown/chart-builder', ['skins/Belchertown/chart-builder/index.html.tmpl']),
('skins/Belchertown/js', ['skins/Belchertown/js/belchertown-config.js.tmpl',
'skins/Belchertown/js/belchertown.js',
'skins/Belchertown/js/belchertown-charts.js',
'skins/Belchertown/js/belchertown-forecast.js',
'skins/Belchertown/js/belchertown-live.js',
'skins/Belchertown/js/belchertown-units.js',
'skins/Belchertown/js/belchertown-chart-builder.js',
'skins/Belchertown/js/belchertown-theme.js',
'skins/Belchertown/js/index.html'
]
),
('skins/Belchertown/json', ['skins/Belchertown/json/index.html',
'skins/Belchertown/json/weewx_data.json.tmpl'
]
),
('skins/Belchertown/images', ['skins/Belchertown/images/clear-day.png',
'skins/Belchertown/images/clear-night.png',
'skins/Belchertown/images/cloudy.png',
'skins/Belchertown/images/drizzle.png',
'skins/Belchertown/images/fog.png',
'skins/Belchertown/images/hail.png',
'skins/Belchertown/images/mostly-clear-day.png',
'skins/Belchertown/images/mostly-clear-night.png',
'skins/Belchertown/images/mostly-cloudy-day.png',
'skins/Belchertown/images/mostly-cloudy-night.png',
'skins/Belchertown/images/partly-cloudy-day.png',
'skins/Belchertown/images/partly-cloudy-night.png',
'skins/Belchertown/images/rain.png',
'skins/Belchertown/images/sleet.png',
'skins/Belchertown/images/snow.png',
'skins/Belchertown/images/snowflake-icon-15px.png',
'skins/Belchertown/images/station.png',
'skins/Belchertown/images/station48.png',
'skins/Belchertown/images/station72.png',
'skins/Belchertown/images/station96.png',
'skins/Belchertown/images/station144.png',
'skins/Belchertown/images/station168.png',
'skins/Belchertown/images/station192.png',
'skins/Belchertown/images/sunrise.png',
'skins/Belchertown/images/sunset.png',
'skins/Belchertown/images/thunderstorm.png',
'skins/Belchertown/images/tornado.png',
'skins/Belchertown/images/unknown.png',
'skins/Belchertown/images/wind.png',
'skins/Belchertown/images/windy.png',
'skins/Belchertown/images/index.html',
'skins/Belchertown/images/aeris-icon-list.json'
]
)
]
files_dict = files
#---------------------------------
# done
#---------------------------------