murrayo / yape

yet another pButtons extractor
MIT License
11 stars 7 forks source link

Error in parsepbuttons.py when vmstat column names on separate line from beg_vmstat #28

Open mcmundt opened 2 years ago

mcmundt commented 2 years ago

I get the following error on a SystemPerformance report generated by IRIS for Health 2021.2:

Traceback (most recent call last):
  File "/usr/local/bin/yape", line 33, in <module>
    sys.exit(load_entry_point('yape', 'console_scripts', 'yape')())
  File "/src/yape/yape/command_line.py", line 6, in main
    yape.yape2()
  File "/src/yape/yape/main.py", line 248, in yape2
    parsepbuttons(args.pButtons_file_name, db)
  File "/src/yape/yape/parsepbuttons.py", line 563, in parsepbuttons
    cursor.execute(query)
sqlite3.OperationalError: near ")": syntax error

This is the part of the html file that is causing the problem. It looks like the Python script expects the column names to be on the same line as \<pre> but in my HTML file the column names start on the following line. If I remove the carriage return between "\<pre>" and "r b" the error goes away:

</pre><p align="right"><font size="3"><a href="#Topofpage">Back to top</a></font></p><hr size="4" noshade><b><font face="Arial, Helvetica, sans-serif" size="4" color="#0000FF"><div id=vmstat></div>vmstat</font></b><br><!-- beg_vmstat --><pre>
  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st