From adfbb8e312703028d38f8f073c677cc27d2b53c4 Mon Sep 17 00:00:00 2001 From: sylvain Date: Sat, 12 Oct 2013 21:02:49 +0200 Subject: [PATCH] add comments --- .project | 17 +++++++++++++++++ .pydevproject | 8 ++++++++ rdpy/protocols/common/layer.py | 23 +++++++++++++++-------- rdpy/protocols/common/protocolbuffer.py | 2 -- 4 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 .project create mode 100644 .pydevproject diff --git a/.project b/.project new file mode 100644 index 0000000..f4c2b6a --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + rdpy + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..653ca1b --- /dev/null +++ b/.pydevproject @@ -0,0 +1,8 @@ + + + +/rdpy + +python 2.7 +twisted-rdp-vnc + diff --git a/rdpy/protocols/common/layer.py b/rdpy/protocols/common/layer.py index 9859564..baf9960 100644 --- a/rdpy/protocols/common/layer.py +++ b/rdpy/protocols/common/layer.py @@ -1,25 +1,28 @@ ''' -Created on 5 sept. 2013 - -@author: sylvain +@author: citronneur ''' - class Layer(object): ''' - classdocs + Network abstraction for protocol + Try as possible to divide user protocol in layer + default implementation is a transparent layer ''' def __init__(self, presentation = None): ''' Constructor ''' + #presentation layer higher layer in model self._presentation = presentation - self._transport= None + #transport layer under layer in model + self._transport = None + #auto set transport layer of own presentation layer if not self._presentation is None: self._presentation._transport = self def connect(self): ''' - signal that the transport layer is OK + call when transport layer is connected + default is send connect event to presentation layer ''' if not self._presentation is None: self._presentation.connect() @@ -27,12 +30,16 @@ class Layer(object): def read(self, data): ''' signal that data is available for this layer + call by transport layer + default is to pass data to presentation layer ''' if not self._presentation is None: self._presentation.read(data) def write(self, data): ''' - write using transport layer + classical use by presentation layer + write data for this layer + default pass data to transport layer ''' self.transport.write(data) \ No newline at end of file diff --git a/rdpy/protocols/common/protocolbuffer.py b/rdpy/protocols/common/protocolbuffer.py index 93997a2..f51c5f0 100644 --- a/rdpy/protocols/common/protocolbuffer.py +++ b/rdpy/protocols/common/protocolbuffer.py @@ -1,6 +1,4 @@ ''' -Created on 17 aout 2013 - @author: sylvain ''' from twisted.internet import protocol