emsec / hal

HAL – The Hardware Analyzer
MIT License
619 stars 74 forks source link

"Extract pin type as python code" generates invalid code #509

Closed RenWal closed 1 year ago

RenWal commented 1 year ago

Describe the bug The "Extract pin type as python code" feature is generating invalid code. Using the code generated by this feature leads to the following error:

> netlist.get_gate_by_id(1).get_type().get_pin_type("QN")
AttributeError: 'hal_py.GateType' object has no attribute 'get_pin_type'

At:
  <string>(2): <module>

To Reproduce Steps to reproduce the behavior:

  1. Select any gate
  2. In the "Selection Details" widget, open the "Pins" tab
  3. Unfold any pin group
  4. Right-click any pin in that pin group to bring up the context menu
  5. Select "Extract pin type as python code"
  6. Paste that code into the Python console and execute
  7. AttributeError is raised

Expected behavior The generated Python code should be valid.