/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/ftp_server/__init__.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2017-06-11 17:59:24 UTC
  • mfrom: (6686.1.4 medusa)
  • Revision ID: breezy.the.bot@gmail.com-20170611175924-a87niklxj8d8l36a
Drop support for medusa, support newer versions of pyftpdlib.

Merged from https://code.launchpad.net/~jelmer/brz/medusa/+merge/325457

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
 
29
29
try:
30
 
    from breezy.tests.ftp_server import medusa_based
31
 
    # medusa is bogus starting with python2.6, since we don't support earlier
32
 
    # pythons anymore, it's currently useless. There is hope though that the
33
 
    # unicode bugs get fixed in the future so we leave it disabled until
34
 
    # then. Keeping the framework in place means that only the following line
35
 
    # will need to be changed.  The last tests were conducted with medusa-2.0
36
 
    # -- vila 20110607
37
 
    medusa_available = False
38
 
except ImportError:
39
 
    medusa_available = False
40
 
 
41
 
 
42
 
try:
43
 
    from breezy.tests.ftp_server import pyftpdlib_based
44
 
    if pyftpdlib_based.pyftplib_version >= (0, 7, 0):
45
 
        pyftpdlib_available = True
46
 
    else:
47
 
        # 0.6.0 breaks SITE CHMOD
48
 
        pyftpdlib_available = False
 
30
    import pyftpdlib
49
31
except ImportError:
50
32
    pyftpdlib_available = False
 
33
else:
 
34
    pyftpdlib_available = True
51
35
 
52
36
 
53
37
class _FTPServerFeature(features.Feature):
56
40
    Right now, the only way this is available is if one of the following is
57
41
    installed:
58
42
 
59
 
    - 'medusa': http://www.amk.ca/python/code/medusa.html
60
43
    - 'pyftpdlib': http://code.google.com/p/pyftpdlib/
61
44
    """
62
45
 
63
46
    def _probe(self):
64
 
        return medusa_available or pyftpdlib_available
 
47
        return pyftpdlib_available
65
48
 
66
49
    def feature_name(self):
67
50
        return 'FTPServer'
92
75
        raise tests.UnavailableFeature(FTPServerFeature)
93
76
 
94
77
 
95
 
if medusa_available:
96
 
    FTPTestServer = medusa_based.FTPTestServer
97
 
elif pyftpdlib_available:
 
78
if pyftpdlib_available:
 
79
    from . import pyftpdlib_based
98
80
    FTPTestServer = pyftpdlib_based.FTPTestServer
99
81
else:
100
82
    FTPTestServer = UnavailableFTPTestServer