|
Move exported-sql-viewer.py from tools/perf/scripts/python/ to
tools/perf/python/ as it is a standalone PySide/PyQt GUI application
for viewing SQLite and PostgreSQL databases exported by perf script.
Improvements and cleanups compared to the legacy script:
- Add support for PySide6 (falling back to PySide2 and PySide) loaded
dynamically via importlib, and provide stub base classes (_QtBase,
_QtWidget) so static analysis (mypy and pylint) and --help-only
execution succeed when Qt bindings are not installed.
- Fix a Python 3 NameError crash in HBoxLayout where expanded_mark and
not_expanded_mark called Python 2's removed unicode() builtin instead
of chr(0x25BC) and chr(0x25B6).
- Replace instance-level method monkey-patching
(self.mousePressEvent = self.MousePressEvent) on SwitchGraphView with
proper class methods gated by self.rb_enabled so Qt virtual method
dispatch works cleanly across PySide2 and PySide6.
- Remove Python 2 constructs (cPickle, xrange), wildcard imports, bare
'except:' clauses, and variable names shadowing Python builtins.
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|