~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/symbol_versioning.py

  • Committer: Matthieu Moy
  • Date: 2006-07-08 19:32:30 UTC
  • mfrom: (1845 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1857.
  • Revision ID: Matthieu.Moy@imag.fr-20060708193230-3eb72d871471bd5b
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
           'deprecated_passed',
27
27
           'warn', 'set_warning_method', 'zero_seven',
28
28
           'zero_eight',
 
29
           'zero_nine',
29
30
           ]
30
31
 
31
32
from warnings import warn
34
35
DEPRECATED_PARAMETER = "A deprecated parameter marker."
35
36
zero_seven = "%s was deprecated in version 0.7."
36
37
zero_eight = "%s was deprecated in version 0.8."
 
38
zero_nine = "%s was deprecated in version 0.9."
37
39
 
38
40
 
39
41
def set_warning_method(method):
113
115
 
114
116
def _decorate_docstring(callable, deprecation_version, label,
115
117
                        decorated_callable):
116
 
    docstring_lines = callable.__doc__.split('\n')
 
118
    if callable.__doc__:
 
119
        docstring_lines = callable.__doc__.split('\n')
 
120
    else:
 
121
        docstring_lines = []
117
122
    if len(docstring_lines) == 0:
118
123
        decorated_callable.__doc__ = deprecation_version % ("This " + label)
119
124
    elif len(docstring_lines) == 1: