diff options
Diffstat (limited to 'glances/folder_list.py')
-rw-r--r-- | glances/folder_list.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/glances/folder_list.py b/glances/folder_list.py index 138bd7dc..7d21236b 100644 --- a/glances/folder_list.py +++ b/glances/folder_list.py @@ -2,7 +2,7 @@ # # This file is part of Glances. # -# SPDX-FileCopyrightText: 2022 Nicolas Hennion <nicolas@nicolargo.com> +# SPDX-FileCopyrightText: 2023 Nicolas Hennion <nicolas@nicolargo.com> # # SPDX-License-Identifier: LGPL-3.0-only # @@ -76,12 +76,12 @@ class FolderList(object): The list is defined in the Glances configuration file. """ - for l in range(1, self.__folder_list_max_size + 1): + for line in range(1, self.__folder_list_max_size + 1): value = {} - key = 'folder_' + str(l) + '_' + key = 'folder_' + str(line) + '_' # Path is mandatory - value['indice'] = str(l) + value['indice'] = str(line) value['path'] = self.config.get_value(section, key + 'path') if value['path'] is None: continue @@ -149,7 +149,7 @@ class FolderList(object): return ret - def update(self): + def update(self, key='path'): """Update the command result attributed.""" # Only continue if monitor list is not empty if len(self.__folder_list) == 0: @@ -160,6 +160,8 @@ class FolderList(object): # Update folder size if not self.first_grab and not self.timer_folders[i].finished(): continue + # Set the key (see issue #2327) + self.__folder_list[i]['key'] = key # Get folder size try: self.__folder_list[i]['size'] = self.__folder_size(self.path(i)) |