diff options
author | Fabian Knittel <fabian.knittel@lettink.de> | 2012-04-26 20:33:21 +0200 |
---|---|---|
committer | Fabian Knittel <fabian.knittel@lettink.de> | 2012-04-26 20:53:06 +0200 |
commit | 017688d836e942e06b1dfabf1ece5dc9c13b986e (patch) | |
tree | 613ecb894bd032a6e619e835a1bb2f8fcf0012a1 | |
parent | 05e56b66a4600a5b9194f47b7f348e3278da69b6 (diff) | |
download | tftpy-017688d836e942e06b1dfabf1ece5dc9c13b986e.tar.gz |
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.
-rw-r--r-- | tftpy/TftpContexts.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tftpy/TftpContexts.py b/tftpy/TftpContexts.py index c3a1bd4..78bf34e 100644 --- a/tftpy/TftpContexts.py +++ b/tftpy/TftpContexts.py @@ -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 |