Stefan Schuermans commited on 2020-05-26 15:40:11
Showing 1 changed files, with 14 additions and 0 deletions.
... | ... |
@@ -249,6 +249,10 @@ class UptGui: |
249 | 249 |
# select process with proc_id |
250 | 250 |
# scroll the process into view |
251 | 251 |
def update(proc_store, proc_path, proc_iter, _ctx): |
252 |
+ """ |
|
253 |
+ Called for every item in tree. |
|
254 |
+ If item matches proc_id, select it and scroll it into view. |
|
255 |
+ """ |
|
252 | 256 |
if proc_store.get_value(proc_iter, self.PROC_PROC_ID) != proc_id: |
253 | 257 |
return |
254 | 258 |
proc_sel.select_iter(proc_iter) |
... | ... |
@@ -271,6 +275,11 @@ class UptGui: |
271 | 275 |
return |
272 | 276 |
# add details of new process |
273 | 277 |
def add(key: str, value: str, parent_iter=None): |
278 |
+ """ |
|
279 |
+ Add a string detail to a process. |
|
280 |
+ Add to specified parent (if parent_iter is specified). |
|
281 |
+ Return iterator to added detail. |
|
282 |
+ """ |
|
274 | 283 |
detail_iter = self.wid_details_tree.append(parent_iter) |
275 | 284 |
self.wid_details_tree.set_value(detail_iter, self.DETAIL_PROC_ID, |
276 | 285 |
-1) |
... | ... |
@@ -280,6 +289,11 @@ class UptGui: |
280 | 289 |
return detail_iter |
281 | 290 |
|
282 | 291 |
def add_list(key: str, values: list, parent_iter=None): |
292 |
+ """ |
|
293 |
+ Add a list of string details to a process as subtree. |
|
294 |
+ Add to specified parent (if parent_iter is specified). |
|
295 |
+ Return iterator to added top-level of detail subtree. |
|
296 |
+ """ |
|
283 | 297 |
if values is None: |
284 | 298 |
return add(key, '???', parent_iter) |
285 | 299 |
list_iter = add(key, f'{len(values):d} entries', parent_iter) |
286 | 300 |