/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 breezy/smart/medium.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
Media carry the bytes of the requests somehow (e.g. via TCP, wrapped in HTTP, or
23
23
over SSH), and pass them to and from the protocol logic.  See the overview in
24
 
brzlib/transport/smart/__init__.py.
 
24
breezy/transport/smart/__init__.py.
25
25
"""
26
26
 
27
27
from __future__ import absolute_import
31
31
import sys
32
32
import time
33
33
 
34
 
import brzlib
35
 
from brzlib.lazy_import import lazy_import
 
34
import breezy
 
35
from breezy.lazy_import import lazy_import
36
36
lazy_import(globals(), """
37
37
import select
38
38
import socket
39
39
import thread
40
40
import weakref
41
41
 
42
 
from brzlib import (
 
42
from breezy import (
43
43
    debug,
44
44
    errors,
45
45
    trace,
47
47
    ui,
48
48
    urlutils,
49
49
    )
50
 
from brzlib.i18n import gettext
51
 
from brzlib.smart import client, protocol, request, signals, vfs
52
 
from brzlib.transport import ssh
 
50
from breezy.i18n import gettext
 
51
from breezy.smart import client, protocol, request, signals, vfs
 
52
from breezy.transport import ssh
53
53
""")
54
 
from brzlib import osutils
 
54
from breezy import osutils
55
55
 
56
56
# Throughout this module buffer size parameters are either limited to be at
57
57
# most _MAX_READ_SIZE, or are ignored and _MAX_READ_SIZE is used instead.
663
663
    """An object that counts the HPSS calls made to each client medium.
664
664
 
665
665
    When a medium is garbage-collected, or failing that when
666
 
    brzlib.global_state exits, the total number of calls made on that medium
 
666
    breezy.global_state exits, the total number of calls made on that medium
667
667
    are reported via trace.note.
668
668
    """
669
669
 
671
671
        self.counts = weakref.WeakKeyDictionary()
672
672
        client._SmartClient.hooks.install_named_hook(
673
673
            'call', self.increment_call_count, 'hpss call counter')
674
 
        brzlib.global_state.cleanups.add_cleanup(self.flush_all)
 
674
        breezy.global_state.cleanups.add_cleanup(self.flush_all)
675
675
 
676
676
    def track(self, medium):
677
677
        """Start tracking calls made to a medium.
953
953
 
954
954
        :param ssh_params: A SSHParams instance.
955
955
        :param vendor: An optional override for the ssh vendor to use. See
956
 
            brzlib.transport.ssh for details on ssh vendors.
 
956
            breezy.transport.ssh for details on ssh vendors.
957
957
        """
958
958
        self._real_medium = None
959
959
        self._ssh_params = ssh_params