~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/__init__.py

(vila) Make all transport put_bytes() raises TypeError when given unicode
 strings rather than bytes (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2006,2011 Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
 
17
"""Smart-server protocol, client and server.
 
18
 
 
19
This code is fairly complex, so it has been split up into a package of modules,
 
20
rather than being a single large module.  Refer to the individual module
 
21
docstrings for details.
 
22
 
 
23
Server-side request handlers are registered in the `bzrlib.smart.request`
 
24
module.
 
25
 
 
26
The domain logic is in `bzrlib.remote`: `RemoteBzrDir`, `RemoteBranch`,
 
27
and so on.
 
28
 
 
29
There is also an plain file-level transport that calls remote methods to
 
30
manipulate files on the server in `bzrlib.transport.remote`.
 
31
 
 
32
The protocol is described in doc/developers/network-protocol.txt.
 
33
 
 
34
"""
 
35
 
 
36
from __future__ import absolute_import
 
37
 
 
38
# TODO: A plain integer from query_version is too simple; should give some
 
39
# capabilities too?
 
40
 
 
41
# TODO: Make each request and response self-validatable, e.g. with checksums.
 
42
#
 
43
# TODO: is it useful to allow multiple chunks in the bulk data?
 
44
#
 
45
# TODO: If we get an exception during transmission of bulk data we can't just
 
46
# emit the exception because it won't be seen.
 
47
#   John proposes:  I think it would be worthwhile to have a header on each
 
48
#   chunk, that indicates it is another chunk. Then you can send an 'error'
 
49
#   chunk as long as you finish the previous chunk.
 
50
#
 
51
 
 
52
# Promote some attributes from submodules into this namespace
 
53
from bzrlib.smart.request import SmartServerRequestHandler
 
54
 
 
55