~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/symbol_versioning.py

  • Committer: Aaron Bentley
  • Date: 2006-06-03 16:23:09 UTC
  • mfrom: (1736 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: aaron.bentley@utoronto.ca-20060603162309-c975ca9ea9fea344
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

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