Minor pylint fixes

This commit is contained in:
Mathieu Comandon 2020-03-26 22:14:27 -07:00
parent ad9b911874
commit 27d8ee1d24
3 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,7 @@
"""DBus backed display management for Mutter"""
from collections import namedtuple
from lutris.util.log import logger
import dbus
from lutris.util.log import logger
DisplayConfig = namedtuple(
"DisplayConfig",
@ -141,7 +141,7 @@ class CRTC():
return "%s %s %s" % (self.id, self.geometry_str, self.current_mode)
@property
def id(self):
def id(self): # pylint: disable=invalid-name
"""The ID in the API of this CRTC"""
return str(self.crtc_info[0])
@ -378,6 +378,7 @@ class DisplayState:
self._state = self.load_state()
def load_state(self):
"""Return current state from dbus interface"""
return self.interface.GetCurrentState()
@property

View file

@ -31,6 +31,7 @@ class GlxInfo:
return ""
def as_dict(self):
"""Return the attributes as a dict"""
return {attr: getattr(self, attr) for attr in self._attrs}
def parse(self):

View file

@ -10,16 +10,16 @@ def _get_last_content_log(steam_data_dir):
path = os.path.join(steam_data_dir, "logs/content_log.txt")
log = []
try:
with open(path, "r") as f:
line = f.readline()
with open(path, "r") as logfile:
line = logfile.readline()
while line:
# Strip old logs
if line == "\r\n" and f.readline() == "\r\n":
if line == "\r\n" and logfile.readline() == "\r\n":
log = []
line = f.readline()
line = logfile.readline()
else:
log.append(line)
line = f.readline()
line = logfile.readline()
except IOError:
return []
return log