Convert some double to single quotes.

This commit is contained in:
Paulus Schoutsen 2015-05-11 22:23:38 -07:00
parent e630476f9f
commit 4eeaa16f16
2 changed files with 16 additions and 15 deletions

View File

@ -28,7 +28,7 @@ from homeassistant.const import (
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
ATTR_COMPONENT = "component" ATTR_COMPONENT = 'component'
PLATFORM_FORMAT = '{}.{}' PLATFORM_FORMAT = '{}.{}'
@ -69,7 +69,7 @@ def _setup_component(hass, domain, config):
if missing_deps: if missing_deps:
_LOGGER.error( _LOGGER.error(
"Not initializing %s because not all dependencies loaded: %s", 'Not initializing %s because not all dependencies loaded: %s',
domain, ", ".join(missing_deps)) domain, ", ".join(missing_deps))
return False return False
@ -89,10 +89,10 @@ def _setup_component(hass, domain, config):
return True return True
else: else:
_LOGGER.error("component %s failed to initialize", domain) _LOGGER.error('component %s failed to initialize', domain)
except Exception: # pylint: disable=broad-except except Exception: # pylint: disable=broad-except
_LOGGER.exception("Error during setup of component %s", domain) _LOGGER.exception('Error during setup of component %s', domain)
return False return False
@ -153,12 +153,12 @@ def from_config_dict(config, hass=None):
if ' ' not in key and key != homeassistant.DOMAIN) if ' ' not in key and key != homeassistant.DOMAIN)
if not core_components.setup(hass, config): if not core_components.setup(hass, config):
_LOGGER.error("Home Assistant core failed to initialize. " _LOGGER.error('Home Assistant core failed to initialize. '
"Further initialization aborted.") 'Further initialization aborted.')
return hass return hass
_LOGGER.info("Home Assistant core initialized") _LOGGER.info('Home Assistant core initialized')
# Setup the components # Setup the components
for domain in loader.load_order_components(components): for domain in loader.load_order_components(components):
@ -189,7 +189,7 @@ def enable_logging(hass):
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
# Log errors to a file if we have write access to file or config dir # Log errors to a file if we have write access to file or config dir
err_log_path = hass.config.path("home-assistant.log") err_log_path = hass.config.path('home-assistant.log')
err_path_exists = os.path.isfile(err_log_path) err_path_exists = os.path.isfile(err_log_path)
# Check if we can write to the error log if it exists or that # Check if we can write to the error log if it exists or that
@ -208,7 +208,7 @@ def enable_logging(hass):
else: else:
_LOGGER.error( _LOGGER.error(
"Unable to setup error log %s (access denied)", err_log_path) 'Unable to setup error log %s (access denied)', err_log_path)
def process_ha_core_config(hass, config): def process_ha_core_config(hass, config):
@ -226,7 +226,7 @@ def process_ha_core_config(hass, config):
hac.time_zone = time_zone hac.time_zone = time_zone
date_util.set_default_time_zone(time_zone) date_util.set_default_time_zone(time_zone)
else: else:
_LOGGER.error("Received invalid time zone %s", time_zone_str) _LOGGER.error('Received invalid time zone %s', time_zone_str)
for key, attr in ((CONF_LATITUDE, 'latitude'), for key, attr in ((CONF_LATITUDE, 'latitude'),
(CONF_LONGITUDE, 'longitude'), (CONF_LONGITUDE, 'longitude'),

View File

@ -137,15 +137,16 @@ class EntityComponent(object):
# Support old deprecated method for now - 3/1/2015 # Support old deprecated method for now - 3/1/2015
if hasattr(platform, 'get_devices'): if hasattr(platform, 'get_devices'):
self.logger.warning( self.logger.warning(
"Please upgrade %s to return new entities using " 'Please upgrade %s to return new entities using '
"setup_platform. See %s/demo.py for an example.", 'setup_platform. See %s/demo.py for an example.',
platform_name, self.domain) platform_name, self.domain)
self.add_entities(platform.get_devices(self.hass, config)) self.add_entities(
platform.get_devices(self.hass, platform_config))
else: else:
self.logger.exception( self.logger.exception(
"Error while setting up platform %s", platform_type) 'Error while setting up platform %s', platform_type)
except Exception: # pylint: disable=broad-except except Exception: # pylint: disable=broad-except
self.logger.exception( self.logger.exception(
"Error while setting up platform %s", platform_type) 'Error while setting up platform %s', platform_type)