~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/ftp.py

  • Committer: John Arbash Meinel
  • Date: 2005-12-15 20:03:03 UTC
  • mto: (1185.50.20 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1532.
  • Revision ID: john@arbash-meinel.com-20051215200303-be2d09abef0f6e57
Added mode to the appropriate transport functions, and tests to make sure they work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
        except ftplib.error_perm, e:
180
180
            raise NoSuchFile(self.abspath(relpath), extra=extra)
181
181
 
182
 
    def put(self, relpath, fp):
 
182
    def put(self, relpath, fp, mode=None):
183
183
        """Copy the file-like or string object into the location.
184
184
 
185
185
        :param relpath: Location to put the contents, relative to base.
186
186
        :param f:       File-like or string object.
 
187
        TODO: jam 20051215 This should be an atomic put, not overwritting files in place
 
188
        TODO: jam 20051215 ftp as a protocol seems to support chmod, but ftplib does not
187
189
        """
188
190
        if not hasattr(fp, 'read'):
189
191
            fp = StringIO(fp)
194
196
        except ftplib.error_perm, e:
195
197
            raise TransportError(orig_error=e)
196
198
 
197
 
    def mkdir(self, relpath):
 
199
    def mkdir(self, relpath, mode=None):
198
200
        """Create a directory at the given path."""
199
201
        try:
200
202
            mutter("FTP mkd: %s" % self._abspath(relpath))