| 205 | |
| 206 | class _reload(delegate.page): |
| 207 | def GET(self): |
| 208 | # make sure the request is coming from the LAN. |
| 209 | if web.ctx.ip not in ["127.0.0.1", "0.0.0.0"] and web.ctx.ip.rsplit(".", 1)[0] != local_ip().rsplit(".", 1)[0]: |
| 210 | return render.permission_denied(web.ctx.fullpath, "Permission denied to reload templates/macros.") |
| 211 | |
| 212 | from infogami.plugins.wikitemplates import code as wikitemplates |
| 213 | |
| 214 | wikitemplates.load_all() |
| 215 | |
| 216 | from openlibrary.plugins.upstream import code as upstream |
| 217 | |
| 218 | upstream.reload() |
| 219 | return delegate.RawText("done") |
| 220 | |
| 221 | |
| 222 | class any: |