~ubuntu-branches/ubuntu/quantal/dput/quantal

« back to all changes in this revision

Viewing changes to ftp.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2006-11-28 15:31:32 UTC
  • mfrom: (1.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20061128153132-0y6a3ih8jbx3fo50
Tags: 0.9.2.26ubuntu1
* Merge from debian unstable. Remaining changes:
  - ubuntu configuration

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                                              progressf=sys.stderr,
49
49
                                              size=size)
50
50
            # print without linefeed
51
 
            sys.stdout.write("Uploading via ftp %s: "% package_name)
 
51
            sys.stdout.write("  %s: "% package_name)
52
52
            sys.stdout.flush()
53
53
            ftp_connection.storbinary('STOR ' + package_name, \
54
54
                                      f, 1024)
55
55
            f.close()
56
56
            print "done."
57
57
        except ftplib.all_errors, e:
58
 
            print "Error '%s' during ftp transfer of %s"%(str(e),package_name)
59
 
            if e.args and e.args[0][:3]=='553':
 
58
            print "\nError '%s' during ftp transfer of %s"%(str(e),package_name)
 
59
            if isinstance(e,ftplib.Error) and e.args and e.args[0][:3]=='553':
60
60
              print """Note: This problem might be caused by files already existent on the server.
61
61
      For the official Debian upload queues, the dcut(1) utility can be used
62
62
      to remove stale files from unsuccessful uploads."""
63
 
            elif e.args and e.args[0][:1]=='5':
 
63
            elif isinstance(e,ftplib.Error) and e.args and e.args[0][:1]=='5':
64
64
              print """Note: This error might indicate a problem with your passive_ftp setting.
65
65
      Please consult dput.cf(5) for details on this configuration option."""
66
66
            if debug: