(self, path, *args, **kwargs)
| 32 | )]) |
| 33 | |
| 34 | def actionUiMedia(self, path, *args, **kwargs): |
| 35 | if path.startswith("/uimedia/plugins/uiconfig/"): |
| 36 | file_path = path.replace("/uimedia/plugins/uiconfig/", plugin_dir + "/media/") |
| 37 | if config.debug and (file_path.endswith("all.js") or file_path.endswith("all.css")): |
| 38 | # If debugging merge *.css to all.css and *.js to all.js |
| 39 | from Debug import DebugMedia |
| 40 | DebugMedia.merge(file_path) |
| 41 | |
| 42 | if file_path.endswith("js"): |
| 43 | data = _.translateData(open(file_path).read(), mode="js").encode("utf8") |
| 44 | elif file_path.endswith("html"): |
| 45 | data = _.translateData(open(file_path).read(), mode="html").encode("utf8") |
| 46 | else: |
| 47 | data = open(file_path, "rb").read() |
| 48 | |
| 49 | return self.actionFile(file_path, file_obj=io.BytesIO(data), file_size=len(data)) |
| 50 | else: |
| 51 | return super(UiRequestPlugin, self).actionUiMedia(path) |
| 52 | |
| 53 | |
| 54 | @PluginManager.registerTo("UiWebsocket") |
nothing calls this directly
no test coverage detected