| Server IP : 217.160.0.244 / Your IP : 216.73.217.138 Web Server : Apache System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64 User : u100174116 ( 6746176) PHP Version : 8.5.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/breezy/__pycache__/ |
Upload File : |
�
p��g� � �$ � S r SSKrSS jrSS jrg)z%General Python convenience functions.� Nc �� � U( a: UR S5 nUSS n[ U 0 0 U5 nU H n[ XE5 nM U$ [ U [ 5 [ 5 / 5 [
R U nU$ )a� Get 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_name�
attr_chain� from_list�obj�attrs �0/usr/lib/python3/dist-packages/breezy/pyutils.py�get_named_objectr sv � �, � !�&�&�s�+�
��r��N� ���b�"�i�8���D��#�$�C� � �J� �;�� �6�8�R�8��k�k�+�&���J� c �� � Ub0 UR SS5 n[ U5 S:X a U SU4$ XS US 4$ U R SS5 n[ U5 S:X a [ SR U 5 5 eUS SUS 4$ )z�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.
Nr r r z*No parent object for top-level module {!r})�rsplit�len�AssertionError�format)r
r �
split_names r �calc_parent_namer = s� � � �� �'�'��Q�/�
��z�?�a����{�3�3��A��
�1�
�>�>� �'�'��Q�/�
��z�?�a�� �<�C�C�K�P��
� �q�M�4��A��7�7r )N)�__doc__r r r � r r �<module>r s ��"