Merge remote branch 'micolous/master' into merge

This commit is contained in:
Michael P. Soulier 2012-10-04 08:25:36 -04:00
commit 47c0eda6d2
2 changed files with 16 additions and 12 deletions

View file

@ -28,8 +28,11 @@ class TftpServer(TftpSession):
# A dict of sessions, where each session is keyed by a string like
# ip:tid for the remote end.
self.sessions = {}
if os.path.exists(self.root):
if self.dyn_file_func:
if not callable(self.dyn_file_func):
raise TftpException, "A dyn_file_func supplied, but it is not callable."
elif os.path.exists(self.root):
log.debug("tftproot %s does exist" % self.root)
if not os.path.isdir(self.root):
raise TftpException, "The tftproot must be a directory."

View file

@ -11,14 +11,15 @@ directly. The TftpClient and TftpServer classes can be reached through it.
import sys
# Make sure that this is at least Python 2.3
verlist = sys.version_info
if not verlist[0] >= 2 or not verlist[1] >= 3:
raise AssertionError, "Requires at least Python 2.3"
required_version = (2, 3)
if sys.version_info < required_version:
raise ImportError, "Requires at least Python 2.3"
from tftpy.TftpShared import *
from tftpy.TftpPacketTypes import *
from tftpy.TftpPacketFactory import *
from tftpy.TftpClient import *
from tftpy.TftpServer import *
from tftpy.TftpContexts import *
from tftpy.TftpStates import *
from TftpShared import *
from TftpPacketTypes import *
from TftpPacketFactory import *
from TftpClient import *
from TftpServer import *
from TftpContexts import *
from TftpStates import *