iotile / coretools

Core python tools for building and using IOTile based devices
GNU General Public License v3.0
14 stars 7 forks source link

Calling watch_broadcasts from python 3 failed with iotile-emulate device #698

Closed timburke closed 5 years ago

timburke commented 5 years ago

I get this exception traceback:

(HardwareManager) watch_broadcasts
Traceback (most recent call last):
  File "/mnt/c/Arch/wsl-firmware/coretools/iotilecore/iotile/core/scripts/iotile_script.py", line 246, in main
    finished = shell.invoke_string(linebuf)
  File "/mnt/c/Arch/wsl-firmware/workspace/env3/lib/python3.6/site-packages/typedargs/shell.py", line 522, in invoke_string
    return self.invoke(args)
  File "/mnt/c/Arch/wsl-firmware/workspace/env3/lib/python3.6/site-packages/typedargs/shell.py", line 493, in invoke
    val, line, finished = self.invoke_one(line)
  File "/mnt/c/Arch/wsl-firmware/workspace/env3/lib/python3.6/site-packages/typedargs/shell.py", line 456, in invoke_one
    val = func(*posargs, **kwargs)
  File "</mnt/c/Arch/wsl-firmware/workspace/env3/lib/python3.6/site-packages/decorator.py:decorator-gen-25>", line 2, in watch_broadcasts
  File "/mnt/c/Arch/wsl-firmware/workspace/env3/lib/python3.6/site-packages/typedargs/utils.py", line 37, in _check_and_execute
    retval = func(*convargs, **convkw)
  File "/mnt/c/Arch/wsl-firmware/coretools/iotilecore/iotile/core/hw/hwmanager.py", line 439, in watch_broadcasts
    line_ui.run()
  File "/mnt/c/Arch/wsl-firmware/coretools/iotilecore/iotile/core/utilities/linebuffer_ui.py", line 73, in run
    Screen.wrapper(self._run_loop, arguments=[refresh_interval])
  File "/mnt/c/Arch/wsl-firmware/workspace/env3/lib/python3.6/site-packages/asciimatics/screen.py", line 1168, in wrapper
    return func(screen, *arguments)
  File "/mnt/c/Arch/wsl-firmware/coretools/iotilecore/iotile/core/utilities/linebuffer_ui.py", line 101, in _run_loop
    lines = self.title_func(self.items)
  File "/mnt/c/Arch/wsl-firmware/coretools/iotilecore/iotile/core/hw/hwmanager.py", line 412, in _title
    return [title, subtitle]
NameError: free variable 'title' referenced before assignment in enclosing scope
mattrunchey commented 5 years ago

That's my mistake. I put the title clause inside of the conditional for bled112 instead of outside. Fixing now.

timburke commented 5 years ago

it looks like subtitle has the same issue too