Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/munch/__pycache__/__init__.cpython-39.pyc
Ðазад
a g�h�W � @ sV d Z ddlmZ zddlmZ W n ey: ddlZY n0 ze�e�Z W n ej yb dZ Y n0 z*eee e �d�d �d�dd� ��ZW n ey� dZY n0 d ZG d d� de�ZG dd � d e�ZG dd� de�ZG dd� de�ZG dd� de�Zefdd�Zdd� ZzNzddlZW n e�y8 ddlZY n0 dd� Zdd� Zee_ee�e_W n e�yp Y n0 z�ddlZddl m!Z!m"Z" dd� Z#dd � Z$d!d"� Z%d#D ]@Z&e'ee&d�Z(e(du �rƐq�ej)d$e#e(d%� ej)d&e#e(d%� �q�e"�*ee$� e"�+ee$� e!�*ee%� e!�+ee%� d'd(� Z,d)d*� Z-e,e_,ee-�e_-W n e�yP Y n0 dS )+a� Munch is a subclass of dict with attribute-style access. >>> b = Munch() >>> b.hello = 'world' >>> b.hello 'world' >>> b['hello'] += "!" >>> b.hello 'world!' >>> b.foo = Munch(lol=True) >>> b.foo.lol True >>> b.foo is b['foo'] True It is safe to import * from this module: __all__ = ('Munch', 'munchify','unmunchify') un/munchify provide dictionary conversion; Munches can also be converted via Munch.to/fromDict(). � )�MappingNz0.0.0�+�.� )r r r )�Munch�munchify�DefaultMunch�DefaultFactoryMunch�RecursiveMunch� unmunchifyc @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Ze dd � �Z dd� Zdd� Zdd� Z dd� ZeZedd� �Zdd� Zdd� Zd!dd�Zd"dd �ZdS )#r a1 A dictionary that provides attribute-style access. >>> b = Munch() >>> b.hello = 'world' >>> b.hello 'world' >>> b['hello'] += "!" >>> b.hello 'world!' >>> b.foo = Munch(lol=True) >>> b.foo.lol True >>> b.foo is b['foo'] True A Munch is a subclass of dict; it supports all the methods a dict does... >>> sorted(b.keys()) ['foo', 'hello'] Including update()... >>> b.update({ 'ponies': 'are pretty!' }, hello=42) >>> print (repr(b)) Munch({'ponies': 'are pretty!', 'foo': Munch({'lol': True}), 'hello': 42}) As well as iteration... >>> sorted([ (k,b[k]) for k in b ]) [('foo', Munch({'lol': True})), ('hello', 42), ('ponies', 'are pretty!')] And "splats". >>> "The {knights} who say {ni}!".format(**Munch(knights='lolcats', ni='can haz')) 'The lolcats who say can haz!' See unmunchify/Munch.toDict, munchify/Munch.fromDict for notes about conversion. c O s | j |i |�� d S �N)�update��self�args�kwargs� r �~/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/munch/__init__.py�__init__W s zMunch.__init__c C sP zt �| |�W S tyJ z| | W Y S tyD t|��Y n0 Y n0 dS )a2 Gets key if it exists, otherwise throws AttributeError. nb. __getattr__ is only called if key is not found in normal places. >>> b = Munch(bar='baz', lol={}) >>> b.foo Traceback (most recent call last): ... AttributeError: foo >>> b.bar 'baz' >>> getattr(b, 'bar') 'baz' >>> b['bar'] 'baz' >>> b.lol is b['lol'] True >>> b.lol is getattr(b, 'lol') True N)�object�__getattribute__�AttributeError�KeyError�r �kr r r �__getattr__[ s zMunch.__getattr__c C sX zt �| |� W n4 tyD z|| |<