Fix pylint messages

This commit is contained in:
Davis Goglin 2016-03-30 13:30:44 -07:00
parent b6b30d7c82
commit 3831665da4
1 changed files with 8 additions and 6 deletions

View File

@ -47,8 +47,8 @@ class Config(object):
try: try:
if isinstance(config_path, str): if isinstance(config_path, str):
with open(config_path, 'rb') as f: with open(config_path, 'rb') as config_file:
config = yaml.safe_load(f) config = yaml.safe_load(config_file)
else: else:
config = yaml.safe_load(config_path) config = yaml.safe_load(config_path)
except EnvironmentError: except EnvironmentError:
@ -63,9 +63,11 @@ class Config(object):
self._printer_name = self._printer_config.pop('type').title() self._printer_name = self._printer_config.pop('type').title()
if not self._printer_name or not hasattr(printer, self._printer_name): if not self._printer_name or not hasattr(printer, self._printer_name):
raise exceptions.ConfigSyntaxError('Printer type "{printer_name}" is invalid'.format( raise exceptions.ConfigSyntaxError(
printer_name=self._printer_name, 'Printer type "{printer_name}" is invalid'.format(
)) printer_name=self._printer_name,
)
)
self._has_loaded = True self._has_loaded = True
@ -79,7 +81,7 @@ class Config(object):
self.load() self.load()
if not self._printer: if not self._printer:
# We could catch init errors and make them a ConfigSyntaxError, # We could catch init errors and make them a ConfigSyntaxError,
# but I'll just let them pass # but I'll just let them pass
self._printer = getattr(printer, self._printer_name)(**self._printer_config) self._printer = getattr(printer, self._printer_name)(**self._printer_config)