diff options
author | nicolargo <nicolas@nicolargo.com> | 2024-02-18 09:50:20 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2024-02-18 09:50:20 +0100 |
commit | 753e9f2d974eef022251b5b539abfae22439c5b1 (patch) | |
tree | dfb73a452ab028144f32648dd70919e5351fc876 | |
parent | 4ab96a72a746ddfe94bd9ec8479cd622bce6935d (diff) |
Remove unused code
-rw-r--r-- | glances/outputs/glances_restful_api.py | 3 | ||||
-rw-r--r-- | glances/plugins/plugin/model.py | 28 |
2 files changed, 3 insertions, 28 deletions
diff --git a/glances/outputs/glances_restful_api.py b/glances/outputs/glances_restful_api.py index 322cc40b..ca8da563 100644 --- a/glances/outputs/glances_restful_api.py +++ b/glances/outputs/glances_restful_api.py @@ -60,7 +60,7 @@ class GlancesRestfulApi(object): self.args = args # Init stats - # Will be updated within Bottle route + # Will be updated within route self.stats = None # cached_time is the minimum time interval between stats updates @@ -262,7 +262,6 @@ class GlancesRestfulApi(object): # Init plugin list self.plugins_list = self.stats.getPluginsList() - # Bind the Bottle TCP address/port if self.args.open_web_browser: # Implementation of the issue #946 # Try to open the Glances Web UI in the default Web browser if: diff --git a/glances/plugins/plugin/model.py b/glances/plugins/plugin/model.py index ba8f2733..993c9a1c 100644 --- a/glances/plugins/plugin/model.py +++ b/glances/plugins/plugin/model.py @@ -507,33 +507,9 @@ class GlancesPluginModel(object): """ ret = {} - if isinstance(self.get_raw(), dict) and \ - self.get_raw() is not None and \ - self.get_key() is not None and \ - self.plugin_name == 'diskio': # TODO <== To be removed when feature/issue2414 is done - # Stats are stored in a dict of dict (ex: DISKIO...) - for key in self.get_raw(): - ret[key] = {} - for field in self.get_raw()[key]: - value = { - 'decoration': 'DEFAULT', - 'optional': False, - 'additional': False, - 'splittable': False, - 'hidden': False, - '_zero': self.views[key][field]['_zero'] - if key in self.views and - field in self.views[key] and - 'zero' in self.views[key][field] - else True, - } - ret[key][field] = value - pass - # TODO: should be removed when feature/issue2414 is done - elif isinstance(self.get_raw(), list) and self.get_raw() is not None and self.get_key() is not None: - # Stats are stored in a list of dict (ex: NETWORK, FS...) + if isinstance(self.get_raw(), list) and self.get_raw() is not None and self.get_key() is not None: + # Stats are stored in a list of dict (ex: DISKIO, NETWORK, FS...) for i in self.get_raw(): - # i[self.get_key()] is the interface name (example for NETWORK) ret[i[self.get_key()]] = {} for key in listkeys(i): value = { |