X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=python%2Fcumulus%2Fstore%2Fftp.py;h=3bd7104efc0a8a9b42cab26894e1781a6174b03b;hb=567bd6a883eaa54d10ca61d0b6083da09bf48085;hp=95dd14ec752187c3d9f92d5edb7327b35c18b5f1;hpb=64bff41cb3ccdd60e767a5bb9ed8525d2dda1966;p=cumulus.git diff --git a/python/cumulus/store/ftp.py b/python/cumulus/store/ftp.py index 95dd14e..3bd7104 100644 --- a/python/cumulus/store/ftp.py +++ b/python/cumulus/store/ftp.py @@ -16,6 +16,8 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +from __future__ import division, print_function, unicode_literals + from ftplib import FTP, all_errors, error_temp from netrc import netrc, NetrcParseError from cumulus.store import Store, type_patterns, NotFoundError @@ -98,16 +100,16 @@ class FtpStore (Store): self.ftp.sendcmd ('TYPE I') size = self.ftp.size (fn) self.ftp.sendcmd ('TYPE A') - except all_errors, err: - print err + except all_errors as err: + print(err) pass if size is not None: return {'size': size} - print "nlst: %s" % fn, size + print("nlst: %s" % fn, size) l = self.ftp.nlst (fn) if l: return {'size': 42} - raise NotFoundError, (type, name) + raise NotFoundError(type, name) def sync (self): """ After a get command at end of transfer a 2XX reply is still @@ -120,7 +122,7 @@ class FtpStore (Store): if not self.synced: self.ftp.voidresp() self.ftp.sendcmd ('TYPE A') - except error_temp, err : + except error_temp as err : if not err.message.startswith ('421') : raise self.connect ()