o ^E@sddlZddlZejddkZddZer-eZeZddl m Z ddZ dd Z d d ZdSeZeZdd l m Z d dZ dd Z dd ZdS)Ncs&Gfddd}t|ddiS)NcseZdZfddZdS)z!with_metaclass..metaclasscs ||SN)clsname this_basesdbasesmetar1/usr/lib/python3/dist-packages/jmespath/compat.py__new__ s z)with_metaclass..metaclass.__new__N)__name__ __module__ __qualname__r rr rr metaclass srtemporary_classr)typer )r r rrr 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)Nunicode_escape) isinstance text_typer)r original_reproriginal_repr_methodrr __repr__%s  z"with_repr_method..__repr__)r!)rr!rrr with_repr_methods r"cc*tj|tjdD] \}}||fVq dSN) predicate)inspect getmembersismethodrrmethodrrr get_methods-  r+) zip_longestcC|Srrrrrr r7scCr.rrr/rrr r";sccr#r$)r&r' isfunctionr)rrr r+>r,)sysr& version_infoPY2runicoder basestring string_type itertoolsrr-rr"r+strrrrr s"