/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/pyutils.py

Merge bzr.dev, update to use new hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Some convenience functions for general Python, such as a wrapper around
18
 
``_import__``."""
 
17
"""General Python convenience functions."""
19
18
 
20
19
 
21
20
import sys
64
63
    """Determine the 'parent' of a given dotted module name and (optional)
65
64
    member name.
66
65
 
67
 
    Typical use is::
68
 
 
69
 
        >>> parent_mod, parent_member, final_attr = calc_parent_name(
70
 
        ...     module_name, member_name) # doctest: +SKIP
71
 
        >>> parent_obj = get_named_object(parent_mod, parent_member)
72
 
        ... # doctest: +SKIP
73
 
 
74
66
    The idea is that ``getattr(parent_obj, final_attr)`` will equal
75
67
    get_named_object(module_name, member_name).
76
68
 
77
69
    :return: (module_name, member_name, final_attr) tuple.
78
70
    """
 
71
# +SKIP is not recognized by python2.4
 
72
# Typical use is::
 
73
 
74
#     >>> parent_mod, parent_member, final_attr = calc_parent_name(
 
75
#     ...     module_name, member_name) # doctest: +SKIP
 
76
#     >>> parent_obj = get_named_object(parent_mod, parent_member)
 
77
#     ... # doctest: +SKIP
79
78
    if member_name is not None:
80
79
        split_name = member_name.rsplit('.', 1)
81
80
        if len(split_name) == 1: