Skip to content

Commit

Permalink
release 4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanganelli committed Mar 1, 2017
1 parent 71c34bd commit 3528b98
Show file tree
Hide file tree
Showing 26 changed files with 81 additions and 57 deletions.
12 changes: 8 additions & 4 deletions coapthon/defines.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = 'Giacomo Tanganelli'

''' CoAP Parameters '''
""" CoAP Parameters """

ACK_TIMEOUT = 2 # standard 2

Expand Down Expand Up @@ -34,7 +34,7 @@

BLOCKWISE_SIZE = 1024

''' Message Format '''
""" Message Format """

# number of bits used for the encoding of the CoAP version field.
VERSION_BITS = 2
Expand Down Expand Up @@ -99,9 +99,10 @@
OptionItem = collections.namedtuple('OptionItem', 'number name value_type repeatable default')


# (NAME, VALUE_TYPE, REPEATABLE, DEFAULT)
class OptionRegistry(object):

"""
All CoAP options. Every option is represented as: (NUMBER, NAME, VALUE_TYPE, REPEATABLE, DEFAULT)
"""
def __init__(self):
pass

Expand Down Expand Up @@ -161,6 +162,9 @@ def __init__(self):


class Codes(object):
"""
CoAP codes. Every code is represented as (NUMBER, NAME)
"""
ERROR_LOWER_BOUND = 128

EMPTY = CodeItem(0, 'EMPTY')
Expand Down
3 changes: 3 additions & 0 deletions coapthon/forward_proxy/coap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@


class CoAP(object):
"""
Implementation of the Forward Proxy
"""
def __init__(self, server_address, multicast=False, starting_mid=None, cache=False, sock=None):
"""
Initialize the Forward Proxy.
Expand Down
6 changes: 3 additions & 3 deletions coapthon/layers/blocklayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def __init__(self, byte, num, m, size, payload=None, content_type=None):


class BlockLayer(object):
"""
Handle the Blockwise options. Hides all the exchange to both servers and clients.
"""
def __init__(self):
"""
Handle the Blockwise options. Hides all the exchange to both servers and clients.
"""
self._block1_sent = {}
self._block2_sent = {}
self._block1_receive = {}
Expand Down
3 changes: 3 additions & 0 deletions coapthon/layers/forwardLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@


class ForwardLayer(object):
"""
Class used by Proxies to forward messages.
"""
def __init__(self, server):
self._server = server

Expand Down
5 changes: 4 additions & 1 deletion coapthon/layers/messagelayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ def str_append_hash(*args):


class MessageLayer(object):
"""
Handles matching between messages (Message ID) and request/response (Token)
"""
def __init__(self, starting_mid):
"""
Handles matching between messages (Message ID) and request/response (Token)
Set the layer internal structure.
:param starting_mid: the first mid used to send messages.
"""
Expand Down
6 changes: 3 additions & 3 deletions coapthon/layers/observelayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def __init__(self, timestamp, non_counter, allowed, transaction):


class ObserveLayer(object):
"""
Manage the observing feature. It store observing relationships.
"""
def __init__(self):
"""
Manage the observing feature. It store observing relationships.
"""
self._relations = {}

def send_request(self, request):
Expand Down
3 changes: 3 additions & 0 deletions coapthon/layers/requestlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@


class RequestLayer(object):
"""
Class to handle the Request/Response layer
"""
def __init__(self, server):
self._server = server

Expand Down
3 changes: 3 additions & 0 deletions coapthon/messages/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@


class Message(object):
"""
Class to handle the Messages.
"""
def __init__(self):
"""
Data structure that represent a CoAP message
Expand Down
3 changes: 3 additions & 0 deletions coapthon/messages/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@


class Option(object):
"""
Class to handle the CoAP Options.
"""
def __init__(self):
"""
Data structure to store options.
Expand Down
3 changes: 3 additions & 0 deletions coapthon/messages/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@


class Request(Message):
"""
Class to handle the Requests.
"""
def __init__(self):
"""
Initialize a Request message.
Expand Down
3 changes: 3 additions & 0 deletions coapthon/messages/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@


class Response(Message):
"""
Class to handle the Responses.
"""
@property
def location_path(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion coapthon/resources/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Resource(object):
"""
The Resource class.
The Resource class. Represents the base class for all resources.
"""
def __init__(self, name, coap_server=None, visible=True, observable=True, allow_children=True):
"""
Expand Down
3 changes: 3 additions & 0 deletions coapthon/reverse_proxy/coap.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@


class CoAP(object):
"""
Implementation of the Reverse Proxy
"""
def __init__(self, server_address, xml_file, multicast=False, starting_mid=None, cache=False, sock=None):
"""
Initialize the Reverse Proxy.
Expand Down
3 changes: 3 additions & 0 deletions coapthon/server/coap.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@


class CoAP(object):
"""
Implementation of the CoAP server
"""
def __init__(self, server_address, multicast=False, starting_mid=None, sock=None):
"""
Initialize the server.
Expand Down
5 changes: 4 additions & 1 deletion coapthon/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@


class Transaction(object):
"""
Transaction object to bind together a request, a response and a resource.
"""
def __init__(self, request=None, response=None, resource=None, timestamp=None):
"""
Initialize a Transaction object to bind together a request, a response and a resource.
Initialize a Transaction object.
:param request: the request
:param response: the response
Expand Down
2 changes: 0 additions & 2 deletions docs/source/coapthon.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ coapthon.client.coap module

.. automodule:: coapthon.client.coap
:members:
:undoc-members:
:show-inheritance:


Expand All @@ -18,5 +17,4 @@ Module contents

.. automodule:: coapthon.client
:members:
:undoc-members:
:show-inheritance:
2 changes: 0 additions & 2 deletions docs/source/coapthon.forward_proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ coapthon.forward_proxy.coap module

.. automodule:: coapthon.forward_proxy.coap
:members:
:undoc-members:
:show-inheritance:


Expand All @@ -18,5 +17,4 @@ Module contents

.. automodule:: coapthon.forward_proxy
:members:
:undoc-members:
:show-inheritance:
20 changes: 20 additions & 0 deletions docs/source/coapthon.http_proxy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
coapthon.client package
=======================

Submodules
----------

coapthon.client.coap module
---------------------------

.. automodule:: coapthon.http_proxy.HCProxy
:members:
:show-inheritance:


Module contents
---------------

.. automodule:: coapthon.http_proxy
:members:
:show-inheritance:
7 changes: 0 additions & 7 deletions docs/source/coapthon.layers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,41 @@ coapthon.layers.blocklayer module

.. automodule:: coapthon.layers.blocklayer
:members:
:undoc-members:
:show-inheritance:

coapthon.layers.forwardLayer module
-----------------------------------

.. automodule:: coapthon.layers.forwardLayer
:members:
:undoc-members:
:show-inheritance:

coapthon.layers.messagelayer module
-----------------------------------

.. automodule:: coapthon.layers.messagelayer
:members:
:undoc-members:
:show-inheritance:

coapthon.layers.observelayer module
-----------------------------------

.. automodule:: coapthon.layers.observelayer
:members:
:undoc-members:
:show-inheritance:

coapthon.layers.requestlayer module
-----------------------------------

.. automodule:: coapthon.layers.requestlayer
:members:
:undoc-members:
:show-inheritance:

coapthon.layers.resourcelayer module
------------------------------------

.. automodule:: coapthon.layers.resourcelayer
:members:
:undoc-members:
:show-inheritance:

coapthon.layers.cachelayer module
Expand All @@ -65,5 +59,4 @@ Module contents

.. automodule:: coapthon.layers
:members:
:undoc-members:
:show-inheritance:
5 changes: 0 additions & 5 deletions docs/source/coapthon.messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,27 @@ coapthon.messages.message module

.. automodule:: coapthon.messages.message
:members:
:undoc-members:
:show-inheritance:

coapthon.messages.option module
-------------------------------

.. automodule:: coapthon.messages.option
:members:
:undoc-members:
:show-inheritance:

coapthon.messages.request module
--------------------------------

.. automodule:: coapthon.messages.request
:members:
:undoc-members:
:show-inheritance:

coapthon.messages.response module
---------------------------------

.. automodule:: coapthon.messages.response
:members:
:undoc-members:
:show-inheritance:


Expand All @@ -42,5 +38,4 @@ Module contents

.. automodule:: coapthon.messages
:members:
:undoc-members:
:show-inheritance:
10 changes: 0 additions & 10 deletions docs/source/coapthon.resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,11 @@ coapthon.resources package
Submodules
----------

coapthon.resources.remoteResource module
----------------------------------------

.. automodule:: coapthon.resources.remoteResource
:members:
:undoc-members:
:show-inheritance:

coapthon.resources.resource module
----------------------------------

.. automodule:: coapthon.resources.resource
:members:
:undoc-members:
:show-inheritance:


Expand All @@ -26,5 +17,4 @@ Module contents

.. automodule:: coapthon.resources
:members:
:undoc-members:
:show-inheritance:
2 changes: 0 additions & 2 deletions docs/source/coapthon.reverse_proxy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ coapthon.reverse_proxy.coap module

.. automodule:: coapthon.reverse_proxy.coap
:members:
:undoc-members:
:show-inheritance:


Expand All @@ -18,5 +17,4 @@ Module contents

.. automodule:: coapthon.reverse_proxy
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit 3528b98

Please sign in to comment.