summaryrefslogtreecommitdiff
path: root/tftpy/TftpContexts.py
diff options
context:
space:
mode:
Diffstat (limited to 'tftpy/TftpContexts.py')
-rw-r--r--tftpy/TftpContexts.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/tftpy/TftpContexts.py b/tftpy/TftpContexts.py
index 4314730..08927e5 100644
--- a/tftpy/TftpContexts.py
+++ b/tftpy/TftpContexts.py
@@ -121,7 +121,7 @@ class TftpContext(object):
def __del__(self):
"""Simple destructor to try to call housekeeping in the end method if
- not called explicitely. Leaking file descriptors is not a good
+ not called explicitly. Leaking file descriptors is not a good
thing."""
self.end()
@@ -137,7 +137,7 @@ class TftpContext(object):
def end(self, close_fileobj=True):
"""Perform session cleanup, since the end method should always be
- called explicitely by the calling code, this works better than the
+ called explicitly by the calling code, this works better than the
destructor.
Set close_fileobj to False so fileobj can be returned open."""
log.debug("in TftpContext.end - closing socket")
@@ -147,12 +147,16 @@ class TftpContext(object):
self.fileobj.close()
def gethost(self):
- "Simple getter method for use in a property."
+ """
+ Simple getter method for use in a property.
+ """
return self.__host
def sethost(self, host):
- """Setter method that also sets the address property as a result
- of the host that is set."""
+ """
+ Setter method that also sets the address property as a result
+ of the host that is set.
+ """
self.__host = host
self.address = socket.gethostbyname(host)
@@ -170,8 +174,10 @@ class TftpContext(object):
next_block = property(getNextBlock, setNextBlock)
def cycle(self):
- """Here we wait for a response from the server after sending it
- something, and dispatch appropriate action to that response."""
+ """
+ Here we wait for a response from the server after sending it
+ something, and dispatch appropriate action to that response.
+ """
try:
(buffer, (raddress, rport)) = self.sock.recvfrom(MAX_BLKSIZE)
except socket.timeout:
@@ -240,10 +246,12 @@ class TftpContextServer(TftpContext):
return "%s:%s %s" % (self.host, self.port, self.state)
def start(self, buffer):
- """Start the state cycle. Note that the server context receives an
+ """
+ Start the state cycle. Note that the server context receives an
initial packet in its start method. Also note that the server does not
loop on cycle(), as it expects the TftpServer object to manage
- that."""
+ that.
+ """
log.debug("In TftpContextServer.start")
self.metrics.start_time = time.time()
log.debug("Set metrics.start_time to %s", self.metrics.start_time)