Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion devicehive/api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiHandler(Handler):

def __init__(self, transport, auth, handler_class, handler_args,
handler_kwargs):
Handler.__init__(self, transport)
super(ApiHandler, self).__init__(transport)
self._api = Api(self._transport, auth)
self._handler = handler_class(self._api, *handler_args,
**handler_kwargs)
Expand Down
6 changes: 3 additions & 3 deletions devicehive/api_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class AuthApiRequest(ApiRequest):
def execute(self, error_message):
self.header(*self._api.token.auth_header)
try:
return ApiRequest.execute(self, error_message)
return super(AuthApiRequest, self).execute(error_message)
except ApiResponseError as api_response_error:
if api_response_error.code != 401:
raise
self._api.token.auth()
self.header(*self._api.token.auth_header)
return ApiRequest.execute(self, error_message)
return super(AuthApiRequest, self).execute(error_message)


class SubscriptionApiRequest(object):
Expand Down Expand Up @@ -170,7 +170,7 @@ class AuthSubscriptionApiRequest(SubscriptionApiRequest):
"""Auth subscription api request class."""

def __init__(self, api):
SubscriptionApiRequest.__init__(self)
super(AuthSubscriptionApiRequest, self).__init__()
auth_header_name, auth_header_value = api.token.auth_header
self._params['headers'][auth_header_name] = auth_header_value
self._params['response_error_handler'] = self.response_error_handler
Expand Down
2 changes: 1 addition & 1 deletion devicehive/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, message, transport_name, code, error):
message = '%s Transport: %s. Code: %s. Error: %s' % (message,
transport_name,
code, error)
Exception.__init__(self, message)
super(ApiResponseError, self).__init__(message)
self._transport_name = transport_name
self._code = code
self._error = error
Expand Down
2 changes: 1 addition & 1 deletion devicehive/data_formats/json_data_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class JsonDataFormat(DataFormat):
"""Json data format class."""

def __init__(self):
DataFormat.__init__(self, 'json', self.TEXT_DATA_TYPE)
super(JsonDataFormat, self).__init__('json', self.TEXT_DATA_TYPE)

def encode(self, data):
return json.dumps(data)
Expand Down
6 changes: 4 additions & 2 deletions devicehive/transports/http_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ class HttpTransport(Transport):

def __init__(self, data_format_class, data_format_options, handler_class,
handler_options):
Transport.__init__(self, 'http', HttpTransportError, data_format_class,
data_format_options, handler_class, handler_options)
super(HttpTransport, self).__init__('http', HttpTransportError,
data_format_class,
data_format_options, handler_class,
handler_options)
self._url = None
self._options = None
self._events_queue_timeout = None
Expand Down
8 changes: 5 additions & 3 deletions devicehive/transports/websocket_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ class WebsocketTransport(Transport):

def __init__(self, data_format_class, data_format_options, handler_class,
handler_options):
Transport.__init__(self, 'websocket', WebsocketTransportError,
data_format_class, data_format_options,
handler_class, handler_options)
super(WebsocketTransport, self).__init__('websocket',
WebsocketTransportError,
data_format_class,
data_format_options,
handler_class, handler_options)
self._websocket = websocket.WebSocket()
self._pong_received = False
self._event_queue = []
Expand Down
2 changes: 1 addition & 1 deletion examples/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class EchoHandler(Handler):

def __init__(self, api, device_id='example-echo-device'):
Handler.__init__(self, api)
super(EchoHandler, self).__init__(api)
self._device_id = device_id
self._device = None

Expand Down
2 changes: 1 addition & 1 deletion examples/raspi_led_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SampleHandler(Handler):
INTERVAL_SECONDS = 5

def __init__(self, api, device_id=DEVICE_ID):
Handler.__init__(self, api)
super(SampleHandler, self).__init__(api)
self._device_id = device_id
self._device = None
self._sensor = TempSensor()
Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TestHandler(Handler):

def __init__(self, api, handle_connect, handle_command_insert,
handle_command_update, handle_notification):
Handler.__init__(self, api)
super(TestHandler, self).__init__(api)
self._handle_connect = handle_connect
self._handle_command_insert = handle_command_insert
self._handle_command_update = handle_command_update
Expand Down