diff --git a/homeassistant/util/__init__.py b/homeassistant/util/__init__.py index b2b4b037384..e177606fb62 100644 --- a/homeassistant/util/__init__.py +++ b/homeassistant/util/__init__.py @@ -18,7 +18,6 @@ from functools import wraps from .dt import datetime_to_local_str, utcnow - RE_SANITIZE_FILENAME = re.compile(r'(~|\.\.|/|\\)') RE_SANITIZE_PATH = re.compile(r'(~|\.(\.)+)') RE_SLUGIFY = re.compile(r'[^a-z0-9_]+') @@ -181,8 +180,10 @@ class OrderedSet(collections.MutableSet): curr = curr[1] def pop(self, last=True): # pylint: disable=arguments-differ - """ Pops element of the end of the set. - Set last=False to pop from the beginning. """ + """ + Pops element of the end of the set. + Set last=False to pop from the beginning. + """ if not self: raise KeyError('set is empty') key = self.end[1][0] if last else self.end[2][0] diff --git a/homeassistant/util/color.py b/homeassistant/util/color.py index 06c9b4c6862..a88fa16896b 100644 --- a/homeassistant/util/color.py +++ b/homeassistant/util/color.py @@ -1,4 +1,8 @@ -"""Color util methods.""" +""" +homeassistant.util.color +~~~~~~~~~~~~~~~~~~~~~~~~ +Color util methods. +""" # Taken from: http://www.cse.unr.edu/~quiroz/inc/colortransforms.py diff --git a/homeassistant/util/environment.py b/homeassistant/util/environment.py index 53364899030..ea4c69e8f13 100644 --- a/homeassistant/util/environment.py +++ b/homeassistant/util/environment.py @@ -1,4 +1,8 @@ -""" Environement helpers. """ +""" +homeassistant.util.environement +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Environement helpers. +""" import sys diff --git a/homeassistant/util/location.py b/homeassistant/util/location.py index 185745d9207..da1a095221c 100644 --- a/homeassistant/util/location.py +++ b/homeassistant/util/location.py @@ -1,4 +1,8 @@ -"""Module with location helpers.""" +""" +homeassistant.util.location +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Module with location helpers. +""" import collections import requests @@ -6,7 +10,6 @@ from vincenty import vincenty ELEVATION_URL = 'http://maps.googleapis.com/maps/api/elevation/json' - LocationInfo = collections.namedtuple( "LocationInfo", ['ip', 'country_code', 'country_name', 'region_code', 'region_name', diff --git a/homeassistant/util/package.py b/homeassistant/util/package.py index fd320090736..91ef15cc7a0 100644 --- a/homeassistant/util/package.py +++ b/homeassistant/util/package.py @@ -1,4 +1,8 @@ -"""Helpers to install PyPi packages.""" +""" +homeassistant.util.package +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Helpers to install PyPi packages. +""" import logging import os import subprocess @@ -13,8 +17,10 @@ INSTALL_LOCK = threading.Lock() def install_package(package, upgrade=True, target=None): - """Install a package on PyPi. Accepts pip compatible package strings. - Return boolean if install successfull.""" + """ + Install a package on PyPi. Accepts pip compatible package strings. + Return boolean if install successful. + """ # Not using 'import pip; pip.main([])' because it breaks the logger with INSTALL_LOCK: if check_package_exists(package, target): @@ -35,9 +41,11 @@ def install_package(package, upgrade=True, target=None): def check_package_exists(package, lib_dir): - """Check if a package is installed globally or in lib_dir. + """ + Check if a package is installed globally or in lib_dir. Returns True when the requirement is met. - Returns False when the package is not installed or doesn't meet req.""" + Returns False when the package is not installed or doesn't meet req. + """ try: req = pkg_resources.Requirement.parse(package) except ValueError: diff --git a/homeassistant/util/temperature.py b/homeassistant/util/temperature.py index 658639aae55..943744597b1 100644 --- a/homeassistant/util/temperature.py +++ b/homeassistant/util/temperature.py @@ -1,7 +1,6 @@ """ homeassistant.util.temperature ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Temperature util functions. """ diff --git a/homeassistant/util/template.py b/homeassistant/util/template.py index bc7431ebf6d..d3ff27791d3 100644 --- a/homeassistant/util/template.py +++ b/homeassistant/util/template.py @@ -1,7 +1,6 @@ """ homeassistant.util.template ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Template utility methods for rendering strings with HA data. """ # pylint: disable=too-few-public-methods