nunobrum / PyLTSpice

Set of tools to interact with LTSpice. See README file for more information.
https://www.nunobrum.com/pyltspice.html
GNU General Public License v3.0
207 stars 59 forks source link

Reading log files #144

Closed hgmolina closed 1 month ago

hgmolina commented 1 month ago

When PyLTSpice\log\ltsteps.py is trying to detect_encoding(log_filename, "Circuit:") (line 319) it's only looking for the first line in the log file. But currently, LTSpice is generating logs like this (Circuit is in the second line):

{22D721FF-AE3D-4960-A4E0-90F075AB2637}

and I'm getting this error: f"Expected string \"{expected_str}\" not found in file:{file_path}"

nunobrum commented 1 month ago

I guess this is a new feature of LTspice. Thanks for the heads up. I'll fix this as soon as possible. If you already fixed it yourself, feel free to make a pull-request.

hgmolina commented 1 month ago

I don't have git tools from the remote developer pc. In \PyLTSpice\utils\detect_encoding.py (line 62), I've changed this: _if not lines[0].startswith(expectedstr): for this _if not lines[0].startswith(expected_str )and not lines[1].startswith(expectedstr):

nunobrum commented 1 month ago

Thanks! Good to know you are not blocked. I'll close this as soon as I publish the fix to PyPi

nunobrum commented 1 month ago

Version 5.4.0 addresses this issue.