diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-04-29 10:09:33 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-04-29 13:21:52 +0200 |
commit | df43156bb35a442c4988631e1c2b0bd0fc11e618 (patch) | |
tree | 77e6c531967013e5628f04e48ba035197b8a737c /examples/charts/memoryusage/memoryusage.py | |
parent | 130e79e4658d2438f66ab8aeb5e186349e3cb740 (diff) |
Examples: Fix some space-related flake warnings
Task-number: PYSIDE-1112
Change-Id: Ib8991199e4822673d6a25cba0023dbe3b03f5938
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/charts/memoryusage/memoryusage.py')
-rw-r--r-- | examples/charts/memoryusage/memoryusage.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/charts/memoryusage/memoryusage.py b/examples/charts/memoryusage/memoryusage.py index 0a098014c..7ad6e3594 100644 --- a/examples/charts/memoryusage/memoryusage.py +++ b/examples/charts/memoryusage/memoryusage.py @@ -55,6 +55,7 @@ def run_process(command, arguments): std_output = process.readAllStandardOutput().data().decode('utf-8') return std_output.split('\n') + def get_memory_usage(): result = [] if sys.platform == 'win32': @@ -83,7 +84,7 @@ def get_memory_usage(): command_column = 12 for line in run_process('ps', ps_options): tokens = line.split(None) - if len(tokens) > command_column and "PID" not in tokens: # Percentage and command + if len(tokens) > command_column and "PID" not in tokens: # Percentage and command command = tokens[command_column] if not command.startswith('['): command = os.path.basename(command) @@ -94,6 +95,7 @@ def get_memory_usage(): result.sort(key = lambda x: x[1], reverse=True) return result + class MainWindow(QMainWindow): def __init__(self): @@ -117,6 +119,7 @@ class MainWindow(QMainWindow): self._chart_view = QChartView(self.chart) self.setCentralWidget(self._chart_view) + if __name__ == '__main__': app = QApplication(sys.argv) main_win = MainWindow() |