Skip to content

Commit

Permalink
Release of version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
liuszeng committed Jun 14, 2016
1 parent 2558c86 commit 0d5bcba
Show file tree
Hide file tree
Showing 34 changed files with 6,655 additions and 203 deletions.
803 changes: 803 additions & 0 deletions AWSIoTPythonSDK/MQTTLib.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions AWSIoTPythonSDK/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))

__version__ = "1.0.0"
Empty file.
96 changes: 96 additions & 0 deletions AWSIoTPythonSDK/core/exception/AWSIoTExceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# /*
# * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# *
# * Licensed under the Apache License, Version 2.0 (the "License").
# * You may not use this file except in compliance with the License.
# * A copy of the License is located at
# *
# * http://aws.amazon.com/apache2.0
# *
# * or in the "license" file accompanying this file. This file is distributed
# * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# * express or implied. See the License for the specific language governing
# * permissions and limitations under the License.
# */

import core.exception.operationTimeoutException as operationTimeoutException
import core.exception.operationError as operationError


# Serial Exception
class acceptTimeoutException(Exception):
def __init__(self, msg="Accept Timeout"):
self.message = msg


# MQTT Operation Timeout Exception
class connectTimeoutException(operationTimeoutException.operationTimeoutException):
def __init__(self, msg="Connect Timeout"):
self.message = msg


class disconnectTimeoutException(operationTimeoutException.operationTimeoutException):
def __init__(self, msg="Disconnect Timeout"):
self.message = msg


class publishTimeoutException(operationTimeoutException.operationTimeoutException):
def __init__(self, msg="Publish Timeout"):
self.message = msg


class subscribeTimeoutException(operationTimeoutException.operationTimeoutException):
def __init__(self, msg="Subscribe Timeout"):
self.message = msg


class unsubscribeTimeoutException(operationTimeoutException.operationTimeoutException):
def __init__(self, msg="Unsubscribe Timeout"):
self.message = msg


# MQTT Operation Error
class connectError(operationError.operationError):
def __init__(self, errorCode):
self.message = "Connect Error: " + str(errorCode)


class disconnectError(operationError.operationError):
def __init__(self, errorCode):
self.message = "Disconnect Error: " + str(errorCode)


class publishError(operationError.operationError):
def __init__(self, errorCode):
self.message = "Publish Error: " + str(errorCode)


class publishQueueFullException(operationError.operationError):
def __init__(self):
self.message = "Internal Publish Queue Full"


class publishQueueDisabledException(operationError.operationError):
def __init__(self):
self.message = "Offline publish request dropped because queueing is disabled"


class subscribeError(operationError.operationError):
def __init__(self, errorCode):
self.message = "Subscribe Error: " + str(errorCode)


class unsubscribeError(operationError.operationError):
def __init__(self, errorCode):
self.message = "Unsubscribe Error: " + str(errorCode)


# Websocket Error
class wssNoKeyInEnvironmentError(operationError.operationError):
def __init__(self):
self.message = "No AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY detected in $ENV."


class wssHandShakeError(operationError.operationError):
def __init__(self):
self.message = "Error in WSS handshake."
Empty file.
19 changes: 19 additions & 0 deletions AWSIoTPythonSDK/core/exception/operationError.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# /*
# * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# *
# * Licensed under the Apache License, Version 2.0 (the "License").
# * You may not use this file except in compliance with the License.
# * A copy of the License is located at
# *
# * http://aws.amazon.com/apache2.0
# *
# * or in the "license" file accompanying this file. This file is distributed
# * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# * express or implied. See the License for the specific language governing
# * permissions and limitations under the License.
# */


class operationError(Exception):
def __init__(self, msg="Operation Error"):
self.message = msg
19 changes: 19 additions & 0 deletions AWSIoTPythonSDK/core/exception/operationTimeoutException.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# /*
# * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# *
# * Licensed under the Apache License, Version 2.0 (the "License").
# * You may not use this file except in compliance with the License.
# * A copy of the License is located at
# *
# * http://aws.amazon.com/apache2.0
# *
# * or in the "license" file accompanying this file. This file is distributed
# * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# * express or implied. See the License for the specific language governing
# * permissions and limitations under the License.
# */


class operationTimeoutException(Exception):
def __init__(self, msg="Operation Timeout"):
self.message = msg
Empty file.
Loading

0 comments on commit 0d5bcba

Please sign in to comment.