From 4f0be4aa2ce921654f63eb72fbcad7c61db68c01 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 30 Jul 2022 15:12:30 +0900 Subject: [PATCH] m1n1.hv: Add `ctx` shell alias for `context`. Signed-off-by: Hector Martin --- proxyclient/m1n1/hv/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxyclient/m1n1/hv/__init__.py b/proxyclient/m1n1/hv/__init__.py index 6a7d46599..56fdff9d4 100644 --- a/proxyclient/m1n1/hv/__init__.py +++ b/proxyclient/m1n1/hv/__init__.py @@ -129,6 +129,8 @@ def _update_shell_locals(self): if callable(a): self.shell_locals[attr] = getattr(self, attr) + self.shell_locals["ctx"] = self.context + def log(self, s, *args, show_cpu=True, **kwargs): if self.ctx is not None and show_cpu: print(f"[cpu{self.ctx.cpu_id}] " + s, *args, **kwargs)