B \E@sddlZddlZejddkZddZerXeZeZddl m Z ddZ dd Z d d Zn,eZeZdd l m Z d dZ dd Z dd ZdS)Ncs&Gfddd}t|ddiS)NcseZdZfddZdS)z!with_metaclass..metaclasscs ||S)N)clsname this_basesd)basesmetar3/tmp/pip-build-uw_ogi45/jmespath/jmespath/compat.py__new__ sz)with_metaclass..metaclass.__new__N)__name__ __module__ __qualname__r r)rr rr metaclass srtemporary_classr)typer )r rrr)rr r with_metaclasssr) izip_longestcCs|j|_dd}||_|S)z@Class decorator that handles __str__ compat between py2 and py3.cSs|dS)Nzutf-8) __unicode__encode)selfrrr __str__sz with_str_method..__str__)rr)rrrrr with_str_methodsrcs|jfdd}||_|S)z6Class decorator that handle __repr__ with py2 and py3.cs |}t|tr|d}|S)NZunicode_escape) isinstance text_typer)rZ original_repr)original_repr_methodrr __repr__%s  z"with_repr_method..__repr__)r)rrr)rr with_repr_methods rccs,x&tj|tjdD]\}}||fVqWdS)N) predicate)inspect getmembersZismethod)rrmethodrrr get_methods-sr") zip_longestcCs|S)Nr)rrrr r7scCs|S)Nr)rrrr r;sccs,x&tj|tjdD]\}}||fVqWdS)N)r)rr Z isfunction)rrr!rrr r">s)sysr version_infoPY2runicoder basestringZ string_type itertoolsrr#rrr"strrrrr s