~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Patch Queue Manager
  • Date: 2014-09-22 19:14:34 UTC
  • mfrom: (6598.1.2 bzr)
  • Revision ID: pqm@pqm.ubuntu.com-20140922191434-6bbnpnxi5jab4vim
(richard-wilbur) Allows launchpad APIs to use proxies by default(Paul Gear).
 (Paul Gear)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
184
184
            fp.close()
185
185
        return length
186
186
 
187
 
    def put_bytes(self, relpath, raw_bytes, mode=None):
 
187
    def put_bytes(self, relpath, bytes, mode=None):
188
188
        """Copy the string into the location.
189
189
 
190
190
        :param relpath: Location to put the contents, relative to base.
191
 
        :param raw_bytes:   String
 
191
        :param bytes:   String
192
192
        """
193
 
        if not isinstance(raw_bytes, str):
194
 
            raise TypeError(
195
 
                'raw_bytes must be a plain string, not %s' % type(raw_bytes))
 
193
 
196
194
        path = relpath
197
195
        try:
198
196
            path = self._abspath(relpath)
202
200
            self._translate_error(e, path)
203
201
        try:
204
202
            if bytes:
205
 
                fp.write(raw_bytes)
 
203
                fp.write(bytes)
206
204
            fp.commit()
207
205
        finally:
208
206
            fp.close()