88from . import exceptions
99
1010_LOGGER = logging .getLogger (__name__ )
11- _RESOURCE = ' {schema}://{host}:{port}/api/{version}'
11+ _RESOURCE = " {schema}://{host}:{port}/api/{version}"
1212
1313
1414class Glances (object ):
1515 """A class for handling the data retrieval."""
1616
17- def __init__ (self , loop , session , host = 'localhost' , port = 61208 , version = 2 ,
18- ssl = False , username = None , password = None ):
17+ def __init__ (
18+ self ,
19+ loop ,
20+ session ,
21+ host = "localhost" ,
22+ port = 61208 ,
23+ version = 2 ,
24+ ssl = False ,
25+ username = None ,
26+ password = None ,
27+ ):
1928 """Initialize the connection."""
20- schema = ' https' if ssl else ' http'
29+ schema = " https" if ssl else " http"
2130 self ._loop = loop
2231 self ._session = session
23- self .url = _RESOURCE .format (schema = schema , host = host , port = port ,
24- version = version )
32+ self .url = _RESOURCE .format (
33+ schema = schema , host = host , port = port , version = version
34+ )
2535 self .data = None
2636 self .values = None
2737 self .plugins = None
@@ -30,7 +40,7 @@ def __init__(self, loop, session, host='localhost', port=61208, version=2,
3040
3141 async def get_data (self ):
3242 """Retrieve the data."""
33- url = ' {}/{}' .format (self .url , ' all' )
43+ url = " {}/{}" .format (self .url , " all" )
3444
3545 try :
3646 with async_timeout .timeout (5 , loop = self ._loop ):
@@ -61,7 +71,7 @@ async def get_metrics(self, element):
6171
6272 async def get_plugins (self ):
6373 """Retrieve the available plugins."""
64- url = ' {}/{}' .format (self .url , ' pluginslist' )
74+ url = " {}/{}" .format (self .url , " pluginslist" )
6575
6676 try :
6777 with async_timeout .timeout (5 , loop = self ._loop ):
0 commit comments