X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=python%2Fcumulus%2Fstore%2Fftp.py;h=ba2e4e75686544250b9f46d97c1ce7b14974c797;hb=a5f66616b1ec0c38328ad5131bf1c889ccc43659;hp=74bf5dd8f0640d8fcdc7e9e2f9a598383c032d11;hpb=a1face58909c717037fce46b26020c573e9ad993;p=cumulus.git diff --git a/python/cumulus/store/ftp.py b/python/cumulus/store/ftp.py index 74bf5dd..ba2e4e7 100644 --- a/python/cumulus/store/ftp.py +++ b/python/cumulus/store/ftp.py @@ -1,3 +1,20 @@ +# Cumulus: Efficient Filesystem Backup to the Cloud +# Copyright (C) 2009 The Cumulus Developers +# See the AUTHORS file for a list of contributors. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. from ftplib import FTP, all_errors, error_temp from netrc import netrc, NetrcParseError @@ -81,16 +98,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 @@ -103,7 +120,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 ()