~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/vfs.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-22 12:52:39 UTC
  • mto: (4471.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4472.
  • Revision ID: v.ladeuil+lp@free.fr-20090622125239-kabo9smxt9c3vnir
Use a consistent scheme for naming pyrex source files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""VFS operations for the smart server.
18
18
 
51
51
 
52
52
class VfsRequest(request.SmartServerRequest):
53
53
    """Base class for VFS requests.
54
 
    
 
54
 
55
55
    VFS requests are disabled if vfs_enabled() returns False.
56
56
    """
57
57
 
72
72
 
73
73
    def do(self, relpath):
74
74
        relpath = self.translate_client_path(relpath)
75
 
        try:
76
 
            backing_bytes = self._backing_transport.get_bytes(relpath)
77
 
        except errors.ReadError:
78
 
            # cannot read the file
79
 
            return request.FailedSmartServerResponse(('ReadError', ))
80
 
        except errors.PermissionDenied:
81
 
            return request.FailedSmartServerResponse(('PermissionDenied',))
 
75
        backing_bytes = self._backing_transport.get_bytes(relpath)
82
76
        return request.SuccessfulSmartServerResponse(('ok',), backing_bytes)
83
77
 
84
78
 
88
82
        relpath = self.translate_client_path(relpath)
89
83
        self._relpath = relpath
90
84
        self._mode = _deserialise_optional_mode(mode)
91
 
    
 
85
 
92
86
    def do_body(self, body_bytes):
93
87
        old_length = self._backing_transport.append_bytes(
94
88
            self._relpath, body_bytes, self._mode)