minor clean-up: remove duplicate dyn_file_func setting

`self.dyn_file_func` is currently set twice: Once in the base class and once in
the server child class.  As it's only used in the non-server case, remove it
from the base class.
master
Fabian Knittel 2012-04-26 20:33:21 +02:00
parent 05e56b66a4
commit 017688d836
1 changed files with 2 additions and 3 deletions

View File

@ -67,7 +67,7 @@ class TftpMetrics(object):
class TftpContext(object):
"""The base class of the contexts."""
def __init__(self, host, port, timeout, dyn_file_func=None):
def __init__(self, host, port, timeout):
"""Constructor for the base context, setting shared instance
variables."""
self.file_to_transfer = None
@ -94,7 +94,6 @@ class TftpContext(object):
self.last_update = 0
# The last packet we sent, if applicable, to make resending easy.
self.last_pkt = None
self.dyn_file_func = dyn_file_func
# Count the number of retry attempts.
self.retry_count = 0
@ -199,11 +198,11 @@ class TftpContextServer(TftpContext):
host,
port,
timeout,
dyn_file_func
)
# At this point we have no idea if this is a download or an upload. We
# need to let the start state determine that.
self.state = TftpStateServerStart(self)
self.root = root
self.dyn_file_func = dyn_file_func