/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/server.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import time
26
26
import threading
27
27
 
28
 
from ...hooks import Hooks
29
 
from ... import (
 
28
from bzrlib.hooks import Hooks
 
29
from bzrlib import (
30
30
    errors,
31
31
    trace,
32
32
    transport as _mod_transport,
33
33
)
34
 
from ...i18n import gettext
35
 
from ...lazy_import import lazy_import
 
34
from bzrlib.i18n import gettext
 
35
from bzrlib.lazy_import import lazy_import
36
36
lazy_import(globals(), """
37
 
from breezy.bzr.smart import (
 
37
from bzrlib.smart import (
38
38
    medium,
39
39
    signals,
40
40
    )
41
 
from breezy.transport import (
 
41
from bzrlib.transport import (
42
42
    chroot,
43
43
    pathfilter,
44
44
    )
45
 
from breezy import (
 
45
from bzrlib import (
46
46
    config,
47
47
    urlutils,
48
48
    )
113
113
                socket.SO_REUSEADDR, 1)
114
114
        try:
115
115
            self._server_socket.bind(sockaddr)
116
 
        except self._socket_error as message:
 
116
        except self._socket_error, message:
117
117
            raise errors.CannotBindAddress(host, port, message)
118
118
        self._sockname = self._server_socket.getsockname()
119
119
        self.port = self._sockname[1]
210
210
                    except self._socket_timeout:
211
211
                        # just check if we're asked to stop
212
212
                        pass
213
 
                    except self._socket_error as e:
 
213
                    except self._socket_error, e:
214
214
                        # if the socket is closed by stop_background_thread
215
215
                        # we might get a EBADF here, or if we get a signal we
216
216
                        # can get EINTR, any other socket errors should get
228
228
            except KeyboardInterrupt:
229
229
                # dont log when CTRL-C'd.
230
230
                raise
231
 
            except Exception as e:
 
231
            except Exception, e:
232
232
                trace.report_exception(sys.exc_info(), sys.stderr)
233
233
                raise
234
234
        finally:
329
329
        These are all empty initially, because by default nothing should get
330
330
        notified.
331
331
        """
332
 
        Hooks.__init__(self, "breezy.bzr.smart.server", "SmartTCPServer.hooks")
 
332
        Hooks.__init__(self, "bzrlib.smart.server", "SmartTCPServer.hooks")
333
333
        self.add_hook('server_started',
334
334
            "Called by the bzr server when it starts serving a directory. "
335
335
            "server_started is called with (backing urls, public url), "
372
372
            base_url = base_url[len('readonly+'):]
373
373
        try:
374
374
            return urlutils.local_path_from_url(base_url)
375
 
        except urlutils.InvalidURL:
 
375
        except errors.InvalidURL:
376
376
            return None
377
377
 
378
378
 
453
453
        self.smart_server = smart_server
454
454
 
455
455
    def _change_globals(self):
456
 
        from breezy import lockdir, ui
 
456
        from bzrlib import lockdir, ui
457
457
        # For the duration of this server, no UI output is permitted. note
458
458
        # that this may cause problems with blackbox tests. This should be
459
459
        # changed with care though, as we dont want to use bandwidth sending