(self)
| 111 | return [self.ns] if self.ns else [] |
| 112 | |
| 113 | def loadscript(self): |
| 114 | logger.info("Loading script %s" % self.path) |
| 115 | if self.ns: |
| 116 | ctx.master.addons.remove(self.ns) |
| 117 | self.ns = None |
| 118 | with addonmanager.safecall(): |
| 119 | ns = load_script(self.fullpath) |
| 120 | ctx.master.addons.register(ns) |
| 121 | self.ns = ns |
| 122 | if self.ns: |
| 123 | try: |
| 124 | ctx.master.addons.invoke_addon_sync( |
| 125 | self.ns, hooks.ConfigureHook(ctx.options.keys()) |
| 126 | ) |
| 127 | except Exception as e: |
| 128 | script_error_handler(self.fullpath, e) |
| 129 | if self.is_running: |
| 130 | # We're already running, so we call that on the addon now. |
| 131 | ctx.master.addons.invoke_addon_sync(self.ns, hooks.RunningHook()) |
| 132 | |
| 133 | async def watcher(self): |
| 134 | # Script loading is terminally confused at the moment. |
no test coverage detected