LUXROBO / pymodi

Python API for controlling modular electronics, MODI

Home Page:https://pymodi.luxrobo.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report]

seankim811 opened this issue · comments

Issue Description

"print_topology_map" throws error.

What I Did

(pymodi) C:\Users\Sean Kim>python
Python 3.6.13 |Anaconda, Inc.| (default, Mar 16 2021, 11:37:27) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import modi
Running PyMODI (v1.2.0)
bundle = modi.MODI()
Initiating serial connection...
Serial is open at "COM13 - USB Serial Device (COM13)"
Start initializing connected MODI modules
Button (2793) has been connected!
Led (1296) has been connected!
MODI init timeout over. Check your module connection.
MODI modules are initialized!

dir(bundle)
['_MODI__init_logger', '_MODI__init_task', '_MODI__wait_user_code_check', 'call', 'class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_conn', '_exe_thrd', '_modules', '_topology_data', '_topology_manager', 'buttons', 'close', 'dials', 'displays', 'envs', 'gyros', 'irs', 'leds', 'mics', 'modules', 'motors', 'network_uuids', 'networks', 'open', 'print_topology_map', 'recv', 'send', 'speakers', 'ultrasonics']
bundle.print_topology_map()
<>
==============================
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\modi.py", line 187, in print_topology_map
self._topology_manager.print_topology_map(print_id)
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\util\topology_util.py", line 254, in print_topology_map
tp_map.print_map(print_id)
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\util\topology_util.py", line 201, in print_map
line += self.__compose_line(curr_elem, padding, print_id)
File "C:\Users\Sean Kim\AppData\Roaming\Python\Python36\site-packages\modi\util\topology_util.py", line 170, in __compose_line
self._modules, module_type.lower()
AttributeError: 'NoneType' object has no attribute 'lower'

Expected Behavior

Tell us what you expected to happen.

System Info

  • PyMODI version: 1.2.0
  • Python version: 3.6
  • Operating System: Win10

You can obtain the pymodi version with:

python -c "import modi"

You can obtain the Python version with:

python --version