mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 14:43:08 +00:00
shell.py: Add only callables to locals, but also sysregs
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
4d75ff90ff
commit
4a918346a8
1 changed files with 7 additions and 2 deletions
|
@ -62,11 +62,16 @@ def run_shell(locals, msg=None, exitmsg=None):
|
|||
if "utils" in locals and "u" not in locals:
|
||||
locals["u"] = locals["utils"]
|
||||
|
||||
for obj in ("iface", "p", "u", "sysreg"):
|
||||
for obj in ("iface", "p", "u"):
|
||||
if obj in locals:
|
||||
for attr in dir(locals[obj]):
|
||||
if attr not in locals:
|
||||
locals[attr] = getattr(locals[obj], attr)
|
||||
v = getattr(locals[obj], attr)
|
||||
if callable(v):
|
||||
locals[attr] = v
|
||||
|
||||
for attr in dir(sysreg):
|
||||
locals[attr] = getattr(sysreg, attr)
|
||||
|
||||
try:
|
||||
con = HistoryConsole(locals)
|
||||
|
|
Loading…
Reference in a new issue