/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/symbol_versioning.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
 
35
35
import warnings
36
 
# Import the 'warn' symbol so bzrlib can call it even if we redefine it
 
36
# Import the 'warn' symbol so breezy can call it even if we redefine it
37
37
from warnings import warn
38
38
 
39
 
import bzrlib
 
39
import breezy
40
40
 
41
41
 
42
42
DEPRECATED_PARAMETER = "A deprecated parameter marker."
49
49
    '%s was deprecated in version 1.4.0.'
50
50
    """
51
51
    return ("%%s was deprecated in version %s."
52
 
            % bzrlib._format_version_tuple(version_tuple))
 
52
            % breezy._format_version_tuple(version_tuple))
53
53
 
54
54
 
55
55
def set_warning_method(method):
81
81
        symbol = "%s.%s" % (a_callable.__module__,
82
82
                            a_callable.__name__)
83
83
    else:
84
 
        symbol = "%s.%s.%s" % (a_callable.im_class.__module__,
85
 
                               a_callable.im_class.__name__,
 
84
        symbol = "%s.%s.%s" % (a_callable.__self__.__class__.__module__,
 
85
                               a_callable.__self__.__class__.__name__,
86
86
                               a_callable.__name__
87
87
                               )
88
88
    return deprecation_version % symbol
96
96
 
97
97
        def decorated_function(*args, **kwargs):
98
98
            """This is the decorated function."""
99
 
            from bzrlib import trace
 
99
            from . import trace
100
100
            trace.mutter_callsite(4, "Deprecated function called")
101
101
            warn(deprecation_string(callable, deprecation_version),
102
102
                DeprecationWarning, stacklevel=2)
124
124
 
125
125
        def decorated_method(self, *args, **kwargs):
126
126
            """This is the decorated method."""
127
 
            from bzrlib import trace
 
127
            from . import trace
128
128
            if callable.__name__ == '__init__':
129
129
                symbol = "%s.%s" % (self.__class__.__module__,
130
130
                                    self.__class__.__name__,