Disable too-many-* (#4107)

* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
This commit is contained in:
Fabian Affolter authored and GitHub committed 2016-10-30 22:18:53 +01:00
1 parent b910a9917d
commit be272ac64a
298 files changed
+271 -570

No files matched your search

@@ -64,7 +64,6 @@ def send_message(hass, message, title=None, data=None):
hass.services.call(DOMAIN, SERVICE_NOTIFY, info)
# pylint: disable=too-many-locals
def setup(hass, config):
"""Setup the notify services."""
success = False
@@ -134,7 +133,6 @@ def setup(hass, config):
return success
# pylint: disable=too-few-public-methods
class BaseNotificationService(object):
"""An abstract class for notification services."""
-2
View File
@@ -130,8 +130,6 @@ class ApnsDevice(object):
class ApnsNotificationService(BaseNotificationService):
"""Implement the notification service for the APNS service."""
# pylint: disable=too-many-arguments
# pylint: disable=too-many-instance-attributes
def __init__(self, hass, app_name, topic, sandbox, cert_file):
"""Initialize APNS application."""
self.hass = hass
@@ -62,7 +62,6 @@ def get_service(hass, config):
return AWSLambda(lambda_client, context)
# pylint: disable=too-few-public-methods
class AWSLambda(BaseNotificationService):
"""Implement the notification service for the AWS Lambda service."""
@@ -54,7 +54,6 @@ def get_service(hass, config):
return AWSSNS(sns_client)
# pylint: disable=too-few-public-methods
class AWSSNS(BaseNotificationService):
"""Implement the notification service for the AWS SNS service."""
@@ -53,7 +53,6 @@ def get_service(hass, config):
return AWSSQS(sqs_client)
# pylint: disable=too-few-public-methods
class AWSSQS(BaseNotificationService):
"""Implement the notification service for the AWS SQS service."""
@@ -29,7 +29,6 @@ def get_service(hass, config):
return CommandLineNotificationService(command)
# pylint: disable=too-few-public-methods
class CommandLineNotificationService(BaseNotificationService):
"""Implement the notification service for the Command Line service."""
-1
View File
@@ -14,7 +14,6 @@ def get_service(hass, config):
return DemoNotificationService(hass)
# pylint: disable=too-few-public-methods
class DemoNotificationService(BaseNotificationService):
"""Implement demo notification service."""
@@ -30,7 +30,6 @@ def get_service(hass, config):
return EcobeeNotificationService(index)
# pylint: disable=too-few-public-methods
class EcobeeNotificationService(BaseNotificationService):
"""Implement the notification service for the Ecobee thermostat."""
-1
View File
@@ -33,7 +33,6 @@ def get_service(hass, config):
return FileNotificationService(hass, filename, timestamp)
# pylint: disable=too-few-public-methods
class FileNotificationService(BaseNotificationService):
"""Implement the notification service for the File service."""
@@ -29,7 +29,6 @@ def get_service(hass, config):
config[CONF_ACCESS_TOKEN])
# pylint: disable=too-few-public-methods
class FreeSMSNotificationService(BaseNotificationService):
"""Implement a notification service for the Free Mobile SMS service."""
-2
View File
@@ -55,11 +55,9 @@ def get_service(hass, config):
config.get(CONF_PORT))
# pylint: disable=too-few-public-methods
class GNTPNotificationService(BaseNotificationService):
"""Implement the notification service for GNTP."""
# pylint: disable=too-many-arguments
def __init__(self, app_name, app_icon, hostname, password, port):
"""Initialize the service."""
import gntp.notifier
-1
View File
@@ -42,7 +42,6 @@ def get_service(hass, config):
return GroupNotifyPlatform(hass, config.get(CONF_SERVICES))
# pylint: disable=too-few-public-methods
class GroupNotifyPlatform(BaseNotificationService):
"""Implement the notification service for the group notify playform."""
-4
View File
@@ -255,7 +255,6 @@ class HTML5PushCallbackView(HomeAssistantView):
# The following is based on code from Auth0
# https://auth0.com/docs/quickstart/backend/python
# pylint: disable=too-many-return-statements
def check_authorization_header(self, request):
"""Check the authorization header."""
import jwt
@@ -320,11 +319,9 @@ class HTML5PushCallbackView(HomeAssistantView):
'event': event_payload[ATTR_TYPE]})
# pylint: disable=too-few-public-methods
class HTML5NotificationService(BaseNotificationService):
"""Implement the notification service for HTML5."""
# pylint: disable=too-many-arguments
def __init__(self, gcm_key, registrations):
"""Initialize the service."""
self._gcm_key = gcm_key
@@ -338,7 +335,6 @@ class HTML5NotificationService(BaseNotificationService):
targets[registration] = registration
return targets
# pylint: disable=too-many-locals
def send_message(self, message="", **kwargs):
"""Send a message to a user."""
import jwt
@@ -60,7 +60,6 @@ def get_service(hass, config):
config.get(CONF_EVENT), config.get(CONF_TRACKER))
# pylint: disable=too-few-public-methods
class InstapushNotificationService(BaseNotificationService):
"""Implementation of the notification service for Instapush."""
-1
View File
@@ -55,7 +55,6 @@ def get_service(hass, config):
return iOSNotificationService()
# pylint: disable=too-few-public-methods, too-many-arguments, invalid-name
class iOSNotificationService(BaseNotificationService):
"""Implement the notification service for iOS."""
@@ -39,7 +39,6 @@ def get_service(hass, config):
return JoinNotificationService(device_id, api_key)
# pylint: disable=too-few-public-methods
class JoinNotificationService(BaseNotificationService):
"""Implement the notification service for Join."""
-1
View File
@@ -41,7 +41,6 @@ def get_service(hass, config):
)
# pylint: disable=too-few-public-methods
class KODINotificationService(BaseNotificationService):
"""Implement the notification service for Kodi."""
@@ -35,7 +35,6 @@ def get_service(hass, config):
return AutomateNotificationService(secret, recipient, device)
# pylint: disable=too-few-public-methods
class AutomateNotificationService(BaseNotificationService):
"""Implement the notification service for LlamaLab Automate."""
@@ -48,11 +48,9 @@ def get_service(hass, config):
)
# pylint: disable=too-few-public-methods
class MatrixNotificationService(BaseNotificationService):
"""Wrapper for the MatrixNotificationClient."""
# pylint: disable=too-many-arguments
def __init__(self, homeserver, default_room, verify_ssl,
username, password):
"""Buffer configuration data for send_message."""
@@ -94,7 +92,6 @@ def store_token(mx_id, token):
handle.write(json.dumps(AUTH_TOKENS))
# pylint: disable=too-many-locals, too-many-arguments
def send_message(message, homeserver, target_rooms, verify_tls,
username, password):
"""Do everything thats necessary to send a message to a Matrix room."""
@@ -40,7 +40,6 @@ def get_service(hass, config):
return MessageBirdNotificationService(config.get(CONF_SENDER), client)
# pylint: disable=too-few-public-methods
class MessageBirdNotificationService(BaseNotificationService):
"""Implement the notification service for MessageBird."""
@@ -98,11 +98,9 @@ def get_service(hass, config):
remoteip, duration, position, transparency, color, interrupt, timeout)
# pylint: disable=too-many-instance-attributes
class NFAndroidTVNotificationService(BaseNotificationService):
"""Notification service for Notifications for Android TV."""
# pylint: disable=too-many-arguments,too-few-public-methods
def __init__(self, remoteip, duration, position, transparency, color,
interrupt, timeout):
"""Initialize the service."""
@@ -117,7 +115,6 @@ class NFAndroidTVNotificationService(BaseNotificationService):
os.path.dirname(__file__), '..', 'frontend', 'www_static', 'icons',
'favicon-192x192.png')
# pylint: disable=too-many-branches
def send_message(self, message="", **kwargs):
"""Send a message to a Android TV device."""
_LOGGER.debug("Sending notification to: %s", self._target)
-1
View File
@@ -37,7 +37,6 @@ def get_service(hass, config):
return NmaNotificationService(config[CONF_API_KEY])
# pylint: disable=too-few-public-methods
class NmaNotificationService(BaseNotificationService):
"""Implement the notification service for NMA."""
@@ -41,7 +41,6 @@ def get_service(hass, config):
return PushBulletNotificationService(pushbullet)
# pylint: disable=too-few-public-methods, too-many-branches
class PushBulletNotificationService(BaseNotificationService):
"""Implement the notification service for Pushbullet."""
@@ -37,7 +37,6 @@ def get_service(hass, config):
return pushetta_service
# pylint: disable=too-few-public-methods
class PushettaNotificationService(BaseNotificationService):
"""Implement the notification service for Pushetta."""
@@ -40,7 +40,6 @@ def get_service(hass, config):
return None
# pylint: disable=too-few-public-methods
class PushoverNotificationService(BaseNotificationService):
"""Implement the notification service for Pushover."""
-1
View File
@@ -52,7 +52,6 @@ def get_service(hass, config):
target_param_name)
# pylint: disable=too-few-public-methods, too-many-arguments
class RestNotificationService(BaseNotificationService):
"""Implementation of a notification service for REST."""
@@ -34,7 +34,6 @@ def get_service(hass, config):
return SendgridNotificationService(api_key, sender, recipient)
# pylint: disable=too-few-public-methods
class SendgridNotificationService(BaseNotificationService):
"""Implementation the notification service for email via Sendgrid."""
@@ -30,7 +30,6 @@ def get_service(hass, config):
return SimplePushNotificationService(config.get(CONF_DEVICE_KEY))
# pylint: disable=too-few-public-methods
class SimplePushNotificationService(BaseNotificationService):
"""Implementation of the notification service for SimplePush."""
-1
View File
@@ -45,7 +45,6 @@ def get_service(hass, config):
return None
# pylint: disable=too-few-public-methods
class SlackNotificationService(BaseNotificationService):
"""Implement the notification service for Slack."""
-2
View File
@@ -63,11 +63,9 @@ def get_service(hass, config):
return None
# pylint: disable=too-few-public-methods, too-many-instance-attributes
class MailNotificationService(BaseNotificationService):
"""Implement the notification service for E-Mail messages."""
# pylint: disable=too-many-arguments
def __init__(self, server, port, sender, starttls, username,
password, recipient, debug):
"""Initialize the service."""
@@ -78,11 +78,9 @@ def get_service(hass, config):
return SyslogNotificationService(facility, option, priority)
# pylint: disable=too-few-public-methods
class SyslogNotificationService(BaseNotificationService):
"""Implement the syslog notification service."""
# pylint: disable=too-many-arguments
def __init__(self, facility, option, priority):
"""Initialize the service."""
self._facility = facility
@@ -77,7 +77,6 @@ def load_data(url=None, file=None, username=None, password=None):
return None
# pylint: disable=too-few-public-methods
class TelegramNotificationService(BaseNotificationService):
"""Implement the notification service for Telegram."""
@@ -41,7 +41,6 @@ def get_service(hass, config):
consumer_key, consumer_secret, phone_number)
# pylint: disable=too-few-public-methods, too-many-arguments
class TelstraNotificationService(BaseNotificationService):
"""Implementation of a notification service for the Telstra SMS API."""
@@ -40,7 +40,6 @@ def get_service(hass, config):
config[CONF_FROM_NUMBER])
# pylint: disable=too-few-public-methods
class TwilioSMSNotificationService(BaseNotificationService):
"""Implement the notification service for the Twilio SMS service."""
@@ -37,7 +37,6 @@ def get_service(hass, config):
)
# pylint: disable=too-few-public-methods
class TwitterNotificationService(BaseNotificationService):
"""Implementation of a notification service for the Twitter service."""
@@ -43,7 +43,6 @@ def get_service(hass, config):
return LgWebOSNotificationService(client)
# pylint: disable=too-few-public-methods
class LgWebOSNotificationService(BaseNotificationService):
"""Implement the notification service for LG WebOS TV."""
-1
View File
@@ -39,7 +39,6 @@ def get_service(hass, config):
config.get('tls'))
# pylint: disable=too-few-public-methods
class XmppNotificationService(BaseNotificationService):
"""Implement the notification service for Jabber (XMPP)."""