@@ -140,8 +140,8 @@ def get_gpu_utilization(self, target):
140140 result = {}
141141 if string is not None and string != '' :
142142 for line in string .split (',' ):
143- key_value = line .split ('=' )
144- result [key_value [ 0 ] .strip ()] = int (key_value [ 1 ] ) if key_value [ 1 ] .isdigit else key_value [ 1 ]
143+ [ key , value ] = line .split ('=' )[: 2 ]
144+ result [key .strip ()] = int (value ) if value .isdigit () else value
145145 return result
146146
147147
@@ -152,8 +152,8 @@ def get_performance_modes(self, target):
152152 for perf in string .split (';' ):
153153 perf_dict = {}
154154 for line in perf .split (',' ):
155- key_value = line .split ('=' )
156- perf_dict [key_value [ 0 ] .strip ()] = int (key_value [ 1 ] ) if key_value [ 1 ] .isdigit else key_value [ 1 ]
155+ [ key , value ] = line .split ('=' )[: 2 ]
156+ perf_dict [key .strip ()] = int (value ) if value .isdigit () else value
157157 result .append (perf_dict )
158158 return result
159159
@@ -288,11 +288,11 @@ def get_fan_rpm(self, target):
288288
289289
290290def get_max_displays (self , target ):
291- """return the maximum number of display devices that can be driven
292- simultaneously on a GPU (e.g., that can be used in a MetaMode at once).
293- Note that this does not indicate the maximum number of bits that can be
294- set in NV_CTRL_CONNECTED_DISPLAYS, because more display devices can be
295- connected than are actively in use."""
291+ """return the maximum number of display devices that can be driven simultaneously on a GPU.
292+
293+ Note that this does not indicate the maximum number of bits that can be set in
294+ NV_CTRL_CONNECTED_DISPLAYS, because more display devices can be connected than are actively
295+ in use."""
296296 return query_int_attribute (self , target , 0 , NV_CTRL_MAX_DISPLAYS )
297297
298298
@@ -5159,7 +5159,7 @@ def type(self):
51595159 return self ._type
51605160
51615161 def __str__ (self ):
5162- return '<nVidia %s #%d>' % (self ._name , self .id ())
5162+ return '<nVidia {} #{}>' . format (self ._name , self .id ())
51635163
51645164
51655165class Gpu (Target ):
0 commit comments