[merge] FTP now has and passes regression tests

John Arbash Meinel john at arbash-meinel.com
Mon May 22 06:34:25 BST 2006


Martin Pool wrote:
> On 18 May 2006, John A Meinel <john at arbash-meinel.com> wrote:
>> -from bzrlib.transport import Transport
>> -from bzrlib.errors import (TransportNotPossible, TransportError,
>> -                           NoSuchFile, FileExists, DirectoryNotEmpty)
>> +try:
>> +    import medusa
>> +    import medusa.filesys
>> +    import medusa.ftp_server
>> +except ImportError:
>> +    _have_medusa = False
>> +else:
>> +    _have_medusa = True
> 
> This will import medusa and asyncore every time the ftp module is loaded, which 
> seems a bit unnecessary.
> 
> More generally it seems a bit wasteful to define the server code in
> the transport modules and so load it every time when we almost always
> only want the client.  But you don't need to change that now.
> 
> +1 from me.

I understand and agree with you. So I rewrote it one more time, moving
the check for medusa as part of get_test_permutations(). Basically, it
is just moving the code around. I attached the diff, but it is pretty
ugly. (Neither cdv diff nor difflib give a clean diff when code moves.)

Can I get another +1?

John
=:->

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: medusa-only-if-testing.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060522/87b2b760/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060522/87b2b760/attachment.pgp 


More information about the bazaar mailing list