HEX
Server: Apache
System: Linux infong-uk86 4.4.400-icpu-106 #2 SMP Mon Sep 15 08:23:40 UTC 2025 x86_64
User: u44115835 (4976590)
PHP: 8.4.17
Disabled: NONE
Upload Files
File: //kunden/lib/python3/dist-packages/breezy/__pycache__/pyutils.cpython-39.pyc
a

�*�^��@s0dZddlmZddlZddd�Zd	dd�ZdS)
z%General Python convenience functions.�)�absolute_importNcCs^|r>|�d�}|dd�}t|ii|�}|D]}t||�}q,nt|t�t�g�tj|}|S)aGet the Python object named by a given module and member name.

    This is usually much more convenient than dealing with ``__import__``
    directly::

        >>> doc = get_named_object('breezy.pyutils', 'get_named_object.__doc__')
        >>> doc.splitlines()[0]
        'Get the Python object named by a given module and member name.'

    :param module_name: a module name, as would be found in sys.modules if
        the module is already imported.  It may contain dots.  e.g. 'sys' or
        'os.path'.
    :param member_name: (optional) a name of an attribute in that module to
        return.  It may contain dots.  e.g. 'MyClass.some_method'.  If not
        given, the named module will be returned instead.
    :raises: ImportError or AttributeError.
    �.N�)�split�
__import__�getattr�globals�locals�sys�modules)�module_name�member_nameZ
attr_chain�	from_list�obj�attr�r�0/usr/lib/python3/dist-packages/breezy/pyutils.py�get_named_objects

rcCs||dur>|�dd�}t|�dkr*|d|fS||d|dfSn:|�dd�}t|�dkrftd|f��n|dd|dfSdS)a
Determine the 'parent' of a given dotted module name and (optional)
    member name.

    The idea is that ``getattr(parent_obj, final_attr)`` will equal
    get_named_object(module_name, member_name).

    :return: (module_name, member_name, final_attr) tuple.
    Nrrrz(No parent object for top-level module %r)�rsplit�len�AssertionError)rr
Z
split_namerrr�calc_parent_name?s
�r)N)N)�__doc__Z
__future__rr
rrrrrr�<module>s
'