Skip to content

Commit 935a5a1

Browse files
Sergey TsimferSergey Tsimfer
authored andcommitted
Update CLI
1 parent ededdbd commit 935a5a1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

nbtools/nbstat/cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ def output_looped(inspector, name, formatter, view_args,
118118
elif inkey == 'm':
119119
if formatter[Resource.DEVICE_UTIL]:
120120
formatter[Resource.DEVICE_UTIL_MA] = not formatter[Resource.DEVICE_UTIL_MA]
121+
elif inkey.code == 265:
122+
formatter[Resource.PID] = not formatter[Resource.PID]
123+
elif inkey.code == 266:
124+
formatter[Resource.CPU] = not formatter[Resource.CPU]
125+
elif inkey.code == 267:
126+
formatter[Resource.TYPE] = not formatter[Resource.TYPE]
121127
elif inkey == 'q':
122128
raise KeyboardInterrupt
123129
else:

nbtools/nbstat/resource_inspector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def get_view(self, name='nbstat', formatter=None, index_condition=None, force_st
507507
raise ValueError('Wrong name of view to get!')
508508

509509
# Filter some processes
510-
if table:
510+
if 'nb' in name and table:
511511
bad_names = ['lsp_server']
512512
function = lambda index_value, _: not any(name in index_value for name in bad_names)
513513
table.filter_on_index(function, inplace=True)

0 commit comments

Comments
 (0)