@@ -156,35 +156,13 @@ def getAllViews(self):
156
156
return json .dumps (self .stats .getAllViewsAsDict ())
157
157
158
158
def getPlugin (self , plugin ):
159
- # Update and return the system stats
159
+ # Update and return the plugin stat
160
160
self .__update__ ()
161
161
return json .dumps (self .stats .get_plugin (plugin ).get_raw ())
162
162
163
- # ['alert', 'ports', 'diskio', 'containers', 'processcount', 'gpu',
164
- # 'percpu', 'system', 'network', 'cpu', 'amps', 'processlist',
165
- # 'load', 'sensors', 'uptime', 'now', 'fs', 'wifi', 'ip', 'help',
166
- # 'version', 'psutilversion', 'core', 'mem', 'folders', 'quicklook', 'memswap', 'raid']
167
-
168
- # It works...
169
- # def getSystem(self):
170
- # return self._get_plugin('system')
171
-
172
- # Do not work...
173
- # def __getattr__(self, item):
174
- # """Overwrite the getattr method in case of attribute is not found.
175
- # The goal is to dynamically generate the API get'Stats'() methods.
176
- # """
177
- # header = 'get'
178
- # # Check if the attribute starts with 'get'
179
- # if item.startswith(header):
180
- # try:
181
- # return self._get_plugin(item[len(header):])
182
- # except Exception:
183
- # # The method is not found for the plugin
184
- # raise AttributeError(item)
185
- # else:
186
- # # Default behavior
187
- # raise AttributeError(item)
163
+ def getPluginView (self , plugin ):
164
+ # Update and return the plugin view
165
+ return json .dumps (self .stats .get_plugin (plugin ).get_views ())
188
166
189
167
190
168
class GlancesServer :
0 commit comments