ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- lib64/python3.8/wsgiref/__pycache__/__init__.cpython-38.pyc000064400000001326152345460470017317 0ustar00U e5dK@sdZdS)aDwsgiref -- a WSGI (PEP 3333) Reference Library Current Contents: * util -- Miscellaneous useful functions and wrappers * headers -- Manage response headers * handlers -- base classes for server/gateway implementations * simple_server -- a simple BaseHTTPServer that supports WSGI * validate -- validation wrapper that sits between an app and a server to detect errors in either To-Do: * cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard) * cgi_wrapper -- Run CGI apps under WSGI * router -- a simple middleware component that handles URL traversal N)__doc__rr(/usr/lib64/python3.8/wsgiref/__init__.pylib64/python3.8/html/__pycache__/__init__.cpython-38.pyc000064400000007044152347517420016620 0ustar00U e5d~@sdZddlZddlmZddgZdddZdd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*"Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddh~Z ddZ e dZ ddZ dS)z* General functions for HTML manipulation. N)html5escapeunescapeTcCsD|dd}|dd}|dd}|r@|dd}|d d }|S) z Replace special characters "&", "<" and ">" to HTML-safe sequences. If the optional flag quote is true (the default), the quotation mark characters, both double quote (") and single quote (') characters are also translated. &z&z>"z"'z')replace)sZquoter %/usr/lib64/python3.8/html/__init__.pyr s     � u€u‚uƒu„u…u†u‡uˆu‰uŠu‹uŒuŽu‘u’u“u”u•u–u—u˜u™ušu›uœužuŸ)"r rrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiii i i i i i i i i i iiiiicCs|d}|ddkr|ddkrsR  ' lib64/python3.8/ctypes/__pycache__/__init__.cpython-38.pyc000064400000037766152351535170017176 0ustar00U e5dE@s dZddlZddlZdZddlmZmZm Z ddlm Z ddlm Z ddlmZ ddlmZmZdd lmZdd lmZee kred ee ejd krdd lmZeZejdkrejdkreejdddkreZddlmZmZ m!Z"m#Z$d}ddZ%d~ddZ&iZ'ddZ(ejd kr\ddlm)Z*ddlm+Z,iZ-ddZ.e.jrte(j/dde._nejdkrtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"Z9Gd#d$d$e8Z:e9e:d%Gd&d'd'e8Z;e9e;Gd(d)d)e8Ze9e>ed.ed/krLe=Z?e>Z@n0Gd0d1d1e8Z?e9e?Gd2d3d3e8Z@e9e@Gd4d5d5e8ZAe9eAGd6d7d7e8ZBe9eBGd8d9d9e8ZCe1eCe1eBkreBZCed/ed:kre=ZDe>ZEn0Gd;d<dd>e8ZEe9eEGd?d@d@e8ZFeFeF_GeF_He9eFGdAdBdBe8ZIeIeI_GeI_He9eIGdCdDdDe8ZJeJeJ_GeJ_He9eJGdEdFdFe8ZKe9eKd%GdGdHdHe8ZLeLZMe9eLGdIdJdJe8ZNddKlmOZOmPZPmQZQGdLdMdMe8ZRGdNdOdOe8ZSdPdQZTddRdSZUdTdUZVdVdWZWGdXdYdYeXZYGdZd[d[eYZZejd krGd\d]d]eYZ[dd^lm\Z\m8Z8Gd_d`d`e8Z]GdadbdbeYZ^GdcddddeXZ_e_eYZ`e_eZZaejd kreZdedejbZcn,ejdfkreZdgejdddhZcneZdZcejd kr8e_e[Zee_e^ZfeejgjhZhddilmiZimjZjddjdkZke1e@e1eLkrTe@Zle?Zmn6e1e>e1eLkrpe>Zle=Zmne1eEe1eLkreEZleDZmddllmnZnmoZompZpmqZqe(eLeLeLelenZre(eLeLe?eleoZsdmdnZtete:eLe:e:eqZudodpZvete:eLe?epZwddrdsZxzddtlmyZyWnezk r(YnXete:eLe?eyZ{ddudvZ|ejd kr`dwdxZ}dydzZ~dd{lmZmZeIZeFZe;e?e=eDfD]@Ze1edhkreZn&e1ed|kreZne1edkreZqeeEfD]@Ze1edhkreZn&e1ed|kreZne1edkreZq[eTdS)z,create and manipulate C data types in PythonNz1.1.0)Union StructureArray)_Pointer)CFuncPtr) __version__) RTLD_LOCAL RTLD_GLOBAL) ArgumentErrorcalcsizezVersion number mismatchnt) FormatErrorposixdarwin.)FUNCFLAG_CDECLFUNCFLAG_PYTHONAPIFUNCFLAG_USE_ERRNOFUNCFLAG_USE_LASTERRORcCszt|trD|dkrt|d}td||t|}|}||_|St|trntdd|t|}|}|St|dS)zcreate_string_buffer(aBytes) -> character array create_string_buffer(anInteger) -> character array create_string_buffer(aBytes, anInteger) -> character array Nzctypes.create_string_buffer) isinstancebyteslen_sysauditc_charvalueint TypeErrorinitsizeZbuftypeZbufr$'/usr/lib64/python3.8/ctypes/__init__.pycreate_string_buffer/s   r&cCs t||SN)r&)r"r#r$r$r%c_bufferCsr(cst|ddrtO|ddr,tO|r@td|ztfWStk rGfdddt}|tf<|YSXdS)aCFUNCTYPE(restype, *argtypes, use_errno=False, use_last_error=False) -> function prototype. restype: the result type argtypes: a sequence specifying the argument types The function prototype can be called in different ways to create a callable object: prototype(integer address) -> foreign function prototype(callable) -> create and return a C callable function from callable prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal prototype((function name, dll object)[, paramflags]) -> foreign function exported by name use_errnoFuse_last_error!unexpected keyword argument(s) %scseZdZZZZdS)z CFUNCTYPE..CFunctionTypeN__name__ __module__ __qualname__ _argtypes_ _restype__flags_r$argtypesflagsrestyper$r% CFunctionTypeesr7N) _FUNCFLAG_CDECLpop_FUNCFLAG_USE_ERRNO_FUNCFLAG_USE_LASTERROR ValueErrorkeys_c_functype_cacheKeyError _CFuncPtr)r6r4kwr7r$r3r% CFUNCTYPEKs  rB) LoadLibrary)FUNCFLAG_STDCALLcst|ddrtO|ddr,tO|r@td|ztfWStk rGfdddt}|tf<|YSXdS)Nr)Fr*r+cseZdZZZZdS)z$WINFUNCTYPE..WinFunctionTypeNr,r$r3r$r%WinFunctionType}srE) _FUNCFLAG_STDCALLr9r:r;r<r=_win_functype_cacher?r@)r6r4rArEr$r3r% WINFUNCTYPEqs  rH)dlopen)sizeofbyref addressof alignmentresize) get_errno set_errno) _SimpleCDatacCsJddlm}|dkr|j}t|||}}||krFtd|||fdS)Nrr z"sizeof(%s) wrong: %d instead of %d)structr _type_rJ SystemError)typtypecoder ZactualZrequiredr$r$r% _check_sizes rWcs eZdZdZfddZZS) py_objectOcs4z tWStk r.dt|jYSXdS)Nz %s())super__repr__r<typer-self __class__r$r%r[s zpy_object.__repr__)r-r.r/rSr[ __classcell__r$r$r_r%rXsrXPc@seZdZdZdS)c_shorthNr-r.r/rSr$r$r$r%rcsrcc@seZdZdZdS)c_ushortHNrer$r$r$r%rfsrfc@seZdZdZdS)c_longlNrer$r$r$r%rhsrhc@seZdZdZdS)c_ulongLNrer$r$r$r%rjsrjiric@seZdZdZdS)c_intrlNrer$r$r$r%rmsrmc@seZdZdZdS)c_uintINrer$r$r$r%rnsrnc@seZdZdZdS)c_floatfNrer$r$r$r%rpsrpc@seZdZdZdS)c_doubledNrer$r$r$r%rrsrrc@seZdZdZdS) c_longdoublegNrer$r$r$r%rtsrtqc@seZdZdZdS) c_longlongrvNrer$r$r$r%rwsrwc@seZdZdZdS) c_ulonglongQNrer$r$r$r%rxsrxc@seZdZdZdS)c_ubyteBNrer$r$r$r%rzsrzc@seZdZdZdS)c_bytebNrer$r$r$r%r|sr|c@seZdZdZdS)rcNrer$r$r$r%rsrc@seZdZdZddZdS)c_char_pzcCsd|jjt|jfSNz%s(%s)r`r-c_void_pZ from_bufferrr]r$r$r%r[szc_char_p.__repr__Nr-r.r/rSr[r$r$r$r%rsrc@seZdZdZdS)rrbNrer$r$r$r%rsrc@seZdZdZdS)c_bool?Nrer$r$r$r%rsr)POINTERpointer_pointer_type_cachec@seZdZdZddZdS) c_wchar_pZcCsd|jjt|jfSrrr]r$r$r%r[szc_wchar_p.__repr__Nrr$r$r$r%rsrc@seZdZdZdS)c_wcharuNrer$r$r$r%rsrcCsFtttjdkr"ttjtt _t jtt _t td<dS)Nr ) rclearr>_osnamerGrZ from_paramrrrrrr$r$r$r% _reset_caches   rcCst|trh|dkrBttdkr6tdd|Dd}n t|d}td||t|}|}||_|St|t rtdd|t|}|}|St |dS)zcreate_unicode_buffer(aString) -> character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array Ncss"|]}t|dkrdndVqdS)irrN)ord).0r~r$r$r% sz(create_unicode_buffer..rzctypes.create_unicode_buffer) rstrrJrsumrrrrrr r!r$r$r%create_unicode_buffers     rcCsLt|ddk rtdt|tkr,td|||t|<tt|=dS)Nz%This type already exists in the cachezWhat's this???)rget RuntimeErroridZset_type)rclsr$r$r%SetPointerType.s  rcCs||Sr'r$)rUrr$r$r%ARRAY8src@sPeZdZdZeZeZdZdZ dZ e ddddfddZ dd Z d d Zd d ZdS)CDLLaAn instance of this class represents a loaded dll/shared library, exporting functions using the standard C calling convention (named 'cdecl' on Windows). The exported functions can be accessed as attributes, or by indexing with the function name. Examples: .qsort -> callable object ['qsort'] -> callable object Calling the functions releases the Python GIL during the call and reacquires it afterwards. zrNFc s|_j|rtO|r$tOtjdrV|rV|drVd|krV|tj tj BO}tj dkr|dk rn|}n6ddl }|j }d|ksd|kr|j_||jO}Gfdd d t}|_|dkrtj|_n|_dS) NZaix)z.a(r r/\cseZdZZjZdS)zCDLL.__init__.._FuncPtrN)r-r.r/r2_func_restype_r1r$r5r^r$r%_FuncPtrosr)_name _func_flags_r:r;rplatform startswithendswithrZ RTLD_MEMBERRTLD_NOWrr Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r_dlopen_handle) r^rmodeZhandler)r*Zwinmoder rr$rr%__init__Ss,   z CDLL.__init__cCs8d|jj|j|jtjdd@t|tjdd@fS)Nz<%s '%s', handle %x at %#x>rr)r`r-rrrmaxsizerr]r$r$r%r[ys  z CDLL.__repr__cCs6|dr|drt|||}t||||S)N__)rrAttributeError __getitem__setattr)r^rfuncr$r$r% __getattr__s   zCDLL.__getattr__cCs"|||f}t|ts||_|Sr')rrrr-)r^Zname_or_ordinalrr$r$r%rs zCDLL.__getitem__)r-r.r/__doc__r8rrmrrrr DEFAULT_MODErr[rrr$r$r$r%r>s  &rc@seZdZdZeeBZdS)PyDLLzThis class represents the Python library itself. It allows accessing Python API functions. The GIL is not released, and Python exceptions are handled correctly. N)r-r.r/rr8_FUNCFLAG_PYTHONAPIrr$r$r$r%rsrc@seZdZdZeZdS)WinDLLznThis class represents a dll exporting functions using the Windows stdcall calling convention. N)r-r.r/rrFrr$r$r$r%rsr)_check_HRESULTrQc@seZdZdZeZdS)HRESULTriN)r-r.r/rSrZ_check_retval_r$r$r$r%rs rc@seZdZdZeZeZdS)OleDLLzThis class represents a dll exporting functions using the Windows stdcall calling convention, and returning HRESULT. HRESULT error values are automatically raised as OSError exceptions. N)r-r.r/rrFrrrr$r$r$r%rsrc@s,eZdZddZddZddZddZd S) LibraryLoadercCs ||_dSr'_dlltype)r^Zdlltyper$r$r%rszLibraryLoader.__init__cCs.|ddkrt|||}t||||S)Nr_)rrr)r^rZdllr$r$r%rs    zLibraryLoader.__getattr__cCs t||Sr')getattrr^rr$r$r%rszLibraryLoader.__getitem__cCs ||Sr'rrr$r$r%rCszLibraryLoader.LoadLibraryN)r-r.r/rrrrCr$r$r$r%rsrz python dllcygwinzlibpython%d.%d.dllr)get_last_errorset_last_errorcCs0|dkrt}|dkr"t|}td|d|Sr') GetLastErrorrstripOSError)codeZdescrr$r$r%WinErrors  r) _memmove_addr _memset_addr_string_at_addr _cast_addrcsGfdddt}|S)NcseZdZZZeeBZdS)z!PYFUNCTYPE..CFunctionTypeN)r-r.r/r0r1r8rr2r$r4r6r$r%r7sr7)r@)r6r4r7r$rr% PYFUNCTYPEsrcCs t|||Sr')_cast)objrUr$r$r%castsrcCs t||S)zAstring_at(addr[, size]) -> string Return the string at addr.) _string_atZptrr#r$r$r% string_atsr)_wstring_at_addrcCs t||S)zFwstring_at(addr[, size]) -> string Return the string at addr.) _wstring_atrr$r$r% wstring_at srcCsBztdttdg}Wntk r.YdSX||||SdS)Ncomtypes.server.inprocserver*i) __import__globalslocals ImportErrorDllGetClassObject)ZrclsidZriidZppvccomr$r$r%rs rcCs8ztdttdg}Wntk r.YdSX|S)Nrrr)rrrrDllCanUnloadNow)rr$r$r%rs r)BigEndianStructureLittleEndianStructure)N)N)N)N)NN)r)r)rosrsysrrZ_ctypesrrrrrr@Z_ctypes_versionrr r rRr Z _calcsize Exceptionrrrrrunamereleasesplitrr8rrrr:rr;r&r(r>rBrCrrDrFrGrHreplacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ __ctype_le__Z __ctype_be__r|rrrZc_voidprrrrrrrrrrobjectrrrrrrrZcdllZpydllZ dllhandleZ pythonapi version_infoZwindllZoledllZkernel32rrrrZc_size_tZ c_ssize_trrrrZmemmoveZmemsetrrrrrrrrrrrZctypes._endianrrZc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%s4          !              N          lib64/python3.8/email/mime/__pycache__/__init__.cpython-38.pyc000064400000000206152351537360017663 0ustar00U .e@sdS)Nrrr+/usr/lib64/python3.8/email/mime/__init__.pylib64/python3.8/collections/__pycache__/__init__.cpython-38.pyc000064400000132546152352002670020170 0ustar00U e5dC @s&dZddddddddd g Zd d lZd d lmZmZd d lm Z d d l Z d d l Zd dlmZd dlmZmZmZd dlmZzd dlmZWnek rYnXej ezd dlm!Z!Wnek rYnXddZ"Gdddej#Z$Gdddej%Z&Gdddej'Z(Gddde)Z*Gddde+Z,zd dlm,Z,Wnek rVYnXzd dlm-Z-Wnek rd d!Z-YnXd"d d d#d$dZ.d%d&Z/zd d'lm/Z/Wnek rYnXGd(dde+Z0Gd)d d ej1Z2Gd*ddej1Z3Gd+ddejZ4Gd,ddej5Z6d S)-a?This module implements specialized container datatypes providing alternatives to Python's general purpose built-in containers, dict, list, set, and tuple. * namedtuple factory function for creating tuple subclasses with named fields * deque list-like container with fast appends and pops on either end * ChainMap dict-like class for creating a single view of multiple mappings * Counter dict subclass for counting hashable objects * OrderedDict dict subclass that remembers the order entries were added * defaultdict dict subclass that calls a factory function to supply missing values * UserDict wrapper around dictionary objects for easier dict subclassing * UserList wrapper around list objects for easier list subclassing * UserString wrapper around string objects for easier string subclassing deque defaultdict namedtupleUserDictUserList UserStringCounter OrderedDictChainMapN) itemgettereq) iskeyword)proxy)repeatchainstarmap)recursive_repr)r)rcCsR|tjkr:tt|}ddl}|jdtdd|t|<|Stdtd|dS)Nr zUsing or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working stacklevelzmodule z has no attribute ) _collections_abc__all__getattrwarningswarnDeprecationWarningglobalsAttributeError__name__)nameobjrr!,/usr/lib64/python3.8/collections/__init__.py __getattr__*s   r#c@seZdZddZdS)_OrderedDictKeysViewccst|jEdHdSNreversed_mappingselfr!r!r" __reversed__?sz!_OrderedDictKeysView.__reversed__Nr __module__ __qualname__r+r!r!r!r"r$=sr$c@seZdZddZdS)_OrderedDictItemsViewccs$t|jD]}||j|fVq dSr%r&r*keyr!r!r"r+Dsz"_OrderedDictItemsView.__reversed__Nr,r!r!r!r"r/Bsr/c@seZdZddZdS)_OrderedDictValuesViewccs t|jD]}|j|Vq dSr%r&r0r!r!r"r+Jsz#_OrderedDictValuesView.__reversed__Nr,r!r!r!r"r2Hsr2c@seZdZdZdS)_Link)prevnextr1 __weakref__N)rr-r. __slots__r!r!r!r"r3Nsr3c@seZdZdZd+ddZejeefddZej fddZ d d Z d d Z d dZ d,ddZ d-ddZddZejjZZddZddZddZejjZeZefddZd.dd Zed!d"Zd#d$Zd%d&Ze d/d'd(Z!d)d*Z"dS)0rz)Dictionary that remembers insertion orderr!cKs\z |jWn>tk rHt|_t|j|_}||_|_i|_YnX|j|f|dS)zInitialize an ordered dictionary. The signature is the same as regular dictionaries. Keyword argument order is preserved. N) _OrderedDict__rootrr3_OrderedDict__hardroot_proxyr4r5_OrderedDict__map_OrderedDict__update)r*otherkwdsrootr!r!r"__init__`s   zOrderedDict.__init__c CsZ||krJ||j|<}|j}|j}||||_|_|_||_|||_||||dS)z!od.__setitem__(i, y) <==> od[i]=yN)r;r8r4r5r1) r*r1valueZ dict_setitemrZLinklinkr?lastr!r!r" __setitem__ms zOrderedDict.__setitem__cCs>||||j|}|j}|j}||_||_d|_d|_dS)z od.__delitem__(y) <==> del od[y]N)r;popr4r5)r*r1Z dict_delitemrB link_prev link_nextr!r!r" __delitem__{s  zOrderedDict.__delitem__ccs(|j}|j}||k r$|jV|j}q dS)zod.__iter__() <==> iter(od)N)r8r5r1r*r?Zcurrr!r!r"__iter__s zOrderedDict.__iter__ccs(|j}|j}||k r$|jV|j}q dS)z#od.__reversed__() <==> reversed(od)N)r8r4r1rIr!r!r"r+s zOrderedDict.__reversed__cCs*|j}||_|_|jt|dS)z.od.clear() -> None. Remove all items from od.N)r8r4r5r;cleardict)r*r?r!r!r"rKs  zOrderedDict.clearTcCsj|s td|j}|r0|j}|j}||_||_n|j}|j}||_||_|j}|j|=t||}||fS)zRemove and return a (key, value) pair from the dictionary. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is empty)KeyErrorr8r4r5r1r;rLrE)r*rCr?rBrFrGr1rAr!r!r"popitems  zOrderedDict.popitemc Cst|j|}|j}|j}|j}||_||_|j}|rR|j}||_||_||_||_n|j}||_||_||_||_dS)zMove an existing element to the end (or beginning if last is false). Raise KeyError if the element does not exist. N)r;r4r5r8) r*r1rCrBrFrGZ soft_linkr?firstr!r!r" move_to_ends$ zOrderedDict.move_to_endcCsVtj}t|d}||j}|||jd7}|||j|7}|||j|7}|S)Nr)_sys getsizeoflen__dict__r;r9r8)r*Zsizeofnsizer!r!r" __sizeof__s  zOrderedDict.__sizeof__cCst|S)z:D.keys() -> a set-like object providing a view on D's keys)r$r)r!r!r"keysszOrderedDict.keyscCst|S)z a set-like object providing a view on D's items)r/r)r!r!r"itemsszOrderedDict.itemscCst|S)z6D.values() -> an object providing a view on D's values)r2r)r!r!r"valuesszOrderedDict.valuescCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerrM)r*r1defaultresultr!r!r"rEs zOrderedDict.popNcCs||kr||S|||<|S)zInsert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. r!r*r1r]r!r!r" setdefaultszOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|fS)zod.__repr__() <==> repr(od)%s()z%s(%r)) __class__rlistrZr)r!r!r"__repr__szOrderedDict.__repr__cCsDt|}ttD]}||dq|jd|p4ddt|fS)z%Return state information for picklingNr!)varscopyrrErbiterrZ)r*Z inst_dictkr!r!r" __reduce__ s zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of odrbr)r!r!r"rfszOrderedDict.copycCs|}|D] }|||<q |S)zYCreate a new ordered dictionary with keys from iterable and values set to value. r!)clsiterablerAr*r1r!r!r"fromkeyss zOrderedDict.fromkeyscCs2t|tr&t||o$ttt||St||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. ) isinstancerrL__eq__allmap_eqr*r=r!r!r"ros zOrderedDict.__eq__)r!)T)T)N)N)#rr-r.__doc__r@rLrDr:r3rHrJr+rKrNrPrXrMutableMappingupdater<rYrZr[__ne__objectr\rEr`_recursive_reprrdrirf classmethodrmror!r!r!r"rQs8            )r) _tuplegettercCstt||dS)N)doc)property _itemgetter)indexr|r!r!r"7rF)renamedefaultsmodulec sttrddttttt|}|rt}t D]B\}}| rrt |sr| dsr||krd||<| |qH|gD]D}t|tk rtd| std|t |rtd|qt}D]F}| dr |s td|||kr"td|| |qi}|d k r|t|}t|tkr^td tttttt|}tttjttd d d d} ddddDdtjtttttf\d| d| d} d|d} t| | | d} d|d| d| _|d k r>|| _tfdd} d|d| j_fdd }d!|d"|_fd#d$}fd%d&}fd'd(}| | j||||fD]}|d)|j|_q|d| dd*||| | ||||d+ }t D](\}}td,|}t ||||<qt|tf|}|d krvzt!d j"#d-d.}Wnt$tfk rtYnX|d k r||_%|S)/aCReturns a new subclass of tuple with named fields. >>> Point = namedtuple('Point', ['x', 'y']) >>> Point.__doc__ # docstring for the new class 'Point(x, y)' >>> p = Point(11, y=22) # instantiate with positional args or keywords >>> p[0] + p[1] # indexable like a plain tuple 33 >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) >>> p.x + p.y # fields also accessible by name 33 >>> d = p._asdict() # convert to a dictionary >>> d['x'] 11 >>> Point(**d) # convert from a dictionary Point(x=11, y=22) >>> p._replace(x=100) # _replace() is like str.replace() but targets named fields Point(x=100, y=22) , _z*Type names and field names must be stringsz6Type names and field names must be valid identifiers: z0Type names and field names cannot be a keyword: z-Field names cannot start with an underscore: z"Encountered duplicate field name: Nz(Got more default values than field names'rQ(, css|]}|dVqdS)z=%rNr!).0rr!r!r" sznamedtuple..)zdef __new__(_cls, z): return _tuple_new(_cls, (z)) namedtuple_) _tuple_newr__new__zCreate new instance of cs2||}|kr.tddt||S)Nz Expected z arguments, got ) TypeErrorrT)rkrlr^)_len num_fields tuple_newr!r"_makes  znamedtuple.._makez Make a new z# object from a sequence or iterablecs.||j|}|r*tdt||S)NzGot unexpected field names: )rrE ValueErrorrc)r*r>r^)_map field_namesr!r"_replacesznamedtuple.._replacez Return a new z2 object replacing specified fields with new valuescs|jj|S)z/Return a nicely formatted representation string)rbrr))repr_fmtr!r"rdsznamedtuple..__repr__cs|j|S)z9Return a new dict which maps field names to their values.)_fieldsr))_dict_zipr!r"_asdictsznamedtuple.._asdictcs|S)z7Return self as a plain tuple. Used by copy and pickle.r!r))_tupler!r"__getnewargs__sz"namedtuple..__getnewargs__.r!) rtr7r_field_defaults_fields_defaultsrrrrdrrzAlias for field number r__main__)&rnstrreplacesplitrcrqrRinternset enumerate isidentifier _iskeyword startswithaddtyperrtuplerTrLr'zipreprjoinrexecrt __defaults__rz__func__rr.r{ _getframe f_globalsgetrr-)typenamerrrrseenrrfield_defaultsarg_lists namespacerrrrdrrmethodclass_namespacer|r^r!) rrrrrrrrrr"r9s             cCs&|j}|D]}||dd||<q dS)z!Tally elements from the iterable.r rQN)r)mappingrlZ mapping_getelemr!r!r"_count_elementssr)rcseZdZdZd/fdd ZddZd0ddZd d Zed1d d Z d2fd d Z d3ddZ ddZ ddZ fddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.ZZS)4raDict subclass for counting hashable items. Sometimes called a bag or multiset. Elements are stored as dictionary keys and their counts are stored as dictionary values. >>> c = Counter('abcdeabcdabcaba') # count elements from a string >>> c.most_common(3) # three most common elements [('a', 5), ('b', 4), ('c', 3)] >>> sorted(c) # list all unique elements ['a', 'b', 'c', 'd', 'e'] >>> ''.join(sorted(c.elements())) # list elements with repetitions 'aaaaabbbbcccdde' >>> sum(c.values()) # total of all counts 15 >>> c['a'] # count of letter 'a' 5 >>> for elem in 'shazam': # update counts from an iterable ... c[elem] += 1 # by adding 1 to each element's count >>> c['a'] # now there are seven 'a' 7 >>> del c['b'] # remove all 'b' >>> c['b'] # now there are zero 'b' 0 >>> d = Counter('simsalabim') # make another counter >>> c.update(d) # add in the second counter >>> c['a'] # now there are nine 'a' 9 >>> c.clear() # empty the counter >>> c Counter() Note: If a count is set to zero or reduced to zero, it will remain in the counter until the entry is deleted or the counter is cleared: >>> c = Counter('aaabbc') >>> c['b'] -= 2 # reduce the count of 'b' by two >>> c.most_common() # 'b' is still in, but its count is zero [('a', 3), ('c', 1), ('b', 0)] Nc s tt||j|f|dS)a Create a new, empty Counter object. And if given, count elements from an input iterable. Or, initialize the count from another mapping of elements to their counts. >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable >>> c = Counter({'a': 4, 'b': 2}) # a new counter from a mapping >>> c = Counter(a=4, b=2) # a new counter from keyword args N)superrr@rv)r*rlr>rjr!r"r@s zCounter.__init__cCsdS)z1The count of elements not in the Counter is zero.r r!r0r!r!r" __missing__*szCounter.__missing__cCs6|dkrt|tdddStj||tddS)zList the n most common elements and their counts from the most common to the least. If n is None, then list all element counts. >>> Counter('abracadabra').most_common(3) [('a', 5), ('b', 2), ('r', 2)] NrQT)r1reverser1)sortedrZr~_heapqnlargestr*rVr!r!r" most_common/s zCounter.most_commoncCsttt|S)aIterator over elements repeating each as many times as its count. >>> c = Counter('ABCABC') >>> sorted(c.elements()) ['A', 'A', 'B', 'B', 'C', 'C'] # Knuth's example for prime factors of 1836: 2**2 * 3**3 * 17**1 >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) >>> product = 1 >>> for factor in prime_factors.elements(): # loop over factors ... product *= factor # and multiply them >>> product 1836 Note, if an element's count has been set to zero or is a negative number, elements() will ignore it. )_chain from_iterable_starmap_repeatrZr)r!r!r"elements<szCounter.elementscCs tddS)Nz@Counter.fromkeys() is undefined. Use Counter(iterable) instead.)NotImplementedError)rkrlvr!r!r"rmTs zCounter.fromkeysc sr|dk r`t|tjrV|rD|j}|D]\}}|||d||<q&q`tt||n t|||rn||dS)aLike dict.update() but add counts instead of replacing them. Source can be an iterable, a dictionary, or another Counter instance. >>> c = Counter('which') >>> c.update('witch') # add elements from another iterable >>> d = Counter('watch') >>> c.update(d) # add elements from another counter >>> c['h'] # four 'h' in which, witch, and watch 4 Nr ) rnrMappingrrZrrrvrr*rlr>self_getrcountrjr!r"rv`s  zCounter.updatecKsn|dk r\|j}t|tjr@|D]\}}||d|||<q"n|D]}||dd||<qD|rj||dS)aLike dict.update() but subtracts counts instead of replacing them. Counts can be reduced below zero. Both the inputs and outputs are allowed to contain zero and negative counts. Source can be an iterable, a dictionary, or another Counter instance. >>> c = Counter('which') >>> c.subtract('witch') # subtract elements from another iterable >>> c.subtract(Counter('watch')) # subtract elements from another counter >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch 0 >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch -1 Nr rQ)rrnrrrZsubtractrr!r!r"rs zCounter.subtractcCs ||S)zReturn a shallow copy.rjr)r!r!r"rfsz Counter.copycCs|jt|ffSr%)rbrLr)r!r!r"riszCounter.__reduce__cs||krt|dS)zGLike dict.__delitem__() but does not raise KeyError for missing values.N)rrH)r*rrjr!r"rHszCounter.__delitem__cCsf|sd|jjSz(dtdj|}d|jj|fWStk r`d|jjt|YSXdS)Nrarz%r: %rz%s({%s})z {0}({1!r})) rbrrrq__mod__rrformatrL)r*rZr!r!r"rds zCounter.__repr__cCspt|tstSt}|D]$\}}|||}|dkr|||<q|D] \}}||krJ|dkrJ|||<qJ|S)zAdd counts from two counters. >>> Counter('abbb') + Counter('bcc') Counter({'b': 4, 'c': 2, 'a': 1}) r rnrNotImplementedrZr*r=r^rrnewcountr!r!r"__add__s    zCounter.__add__cCstt|tstSt}|D]$\}}|||}|dkr|||<q|D]$\}}||krJ|dkrJd|||<qJ|S)z Subtract count, but keep only results with positive counts. >>> Counter('abbbc') - Counter('bccd') Counter({'b': 2, 'a': 1}) r rrr!r!r"__sub__s   zCounter.__sub__cCs|t|tstSt}|D]0\}}||}||kr8|n|}|dkr|||<q|D] \}}||krV|dkrV|||<qV|S)zUnion is the maximum of value in either of the input counters. >>> Counter('abbb') | Counter('bcc') Counter({'b': 3, 'c': 2, 'a': 1}) r rr*r=r^rr other_countrr!r!r"__or__s   zCounter.__or__cCsRt|tstSt}|D]0\}}||}||kr8|n|}|dkr|||<q|S)z Intersection is the minimum of corresponding counts. >>> Counter('abbb') & Counter('bcc') Counter({'b': 1}) r rrr!r!r"__and__s  zCounter.__and__cCs,t}|D]\}}|dkr|||<q|S)zEAdds an empty counter, effectively stripping negative and zero countsr rrZr*r^rrr!r!r"__pos__ s  zCounter.__pos__cCs0t}|D]\}}|dkrd|||<q|S)z{Subtracts from an empty counter. Strips positive and zero counts, and flips the sign on negative counts. r rrr!r!r"__neg__s zCounter.__neg__cCs&dd|D}|D] }||=q|S)z?Internal method to strip elements with a negative or zero countcSsg|]\}}|dks|qS)r r!)rrrr!r!r" "sz*Counter._keep_positive..)rZ)r* nonpositiverr!r!r"_keep_positive szCounter._keep_positivecCs*|D]\}}|||7<q|S)zInplace add from another counter, keeping only positive counts. >>> c = Counter('abbb') >>> c += Counter('bcc') >>> c Counter({'b': 4, 'c': 2, 'a': 1}) rZrr*r=rrr!r!r"__iadd__'s zCounter.__iadd__cCs*|D]\}}|||8<q|S)zInplace subtract counter, but keep only results with positive counts. >>> c = Counter('abbbc') >>> c -= Counter('bccd') >>> c Counter({'b': 2, 'a': 1}) rrr!r!r"__isub__4s zCounter.__isub__cCs2|D] \}}||}||kr|||<q|S)zInplace union is the maximum of value from either counter. >>> c = Counter('abbb') >>> c |= Counter('bcc') >>> c Counter({'b': 3, 'c': 2, 'a': 1}) r)r*r=rrrr!r!r"__ior__As  zCounter.__ior__cCs2|D] \}}||}||kr|||<q|S)zInplace intersection is the minimum of corresponding counts. >>> c = Counter('abbb') >>> c &= Counter('bcc') >>> c Counter({'b': 1}) r)r*r=rrrr!r!r"__iand__Ps  zCounter.__iand__)N)N)N)N)N)rr-r.rtr@rrrrzrmrvrrfrirHrdrrrrrrrrrrr __classcell__r!r!rjr"rs02  !     c@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZd(ddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS))r a A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can be accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)rcmaps)r*rr!r!r"r@rszChainMap.__init__cCs t|dSr%)rMr0r!r!r"ryszChainMap.__missing__c Cs:|jD](}z||WStk r,YqXq||Sr%)rrMr)r*r1rr!r!r" __getitem__|s  zChainMap.__getitem__NcCs||kr||S|Sr%r!r_r!r!r"rsz ChainMap.getcCsttj|jSr%)rTrunionrr)r!r!r"__len__szChainMap.__len__cCs&i}t|jD]}||qt|Sr%)r'rrvrg)r*drr!r!r"rJs zChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdSr%r!)rmrr!r"rsz(ChainMap.__contains__..anyrr0r!rr" __contains__szChainMap.__contains__cCs t|jSr%rr)r!r!r"__bool__szChainMap.__bool__cCs"|jjddtt|jdS)Nrrr)rbrrrqrrr)r!r!r"rdszChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)rLrm)rkrlargsr!r!r"rmszChainMap.fromkeyscCs$|j|jdf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r rQN)rbrrfr)r!r!r"rfsz ChainMap.copycCs|dkr i}|j|f|jS)zyNew ChainMap with a new map followed by all previous maps. If no map is provided, an empty dict is used. Nrbr)r*rr!r!r" new_childszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rQNrr)r!r!r"parentsszChainMap.parentscCs||jd|<dSNr )r)r*r1rAr!r!r"rDszChainMap.__setitem__cCs8z|jd|=Wn"tk r2td|YnXdS)Nr (Key not found in the first mapping: {!r})rrMrr0r!r!r"rHszChainMap.__delitem__cCs2z|jdWStk r,tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.r z#No keys found in the first mapping.N)rrNrMr)r!r!r"rNszChainMap.popitemcGs@z|jdj|f|WStk r:td|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r rN)rrErMr)r*r1rr!r!r"rEsz ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.r N)rrKr)r!r!r"rKszChainMap.clear)N)N)rr-r.rtr@rrrrrJrrryrdrzrmrf__copy__rr}rrDrHrNrErKr!r!r!r"r ds.      c@speZdZddZde_ddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ edddZdS)rcOs|s td|^}}t|dkr0tdt||r>|d}n0d|krj|d}ddl}|jdtddnd}i|_|dk r|||r||dS) Nzd?Z"dS)BrzAA more or less complete user-defined wrapper around list objects.NcCsbg|_|dk r^t|t|jkr0||jdd<n.t|trT|jdd|jdd<n t||_dSr%)rrrnrrc)r*initlistr!r!r"r@!s zUserList.__init__cCs t|jSr%r r)r!r!r"rd+rzUserList.__repr__cCs|j||kSr%r_UserList__castrsr!r!r"__lt__,rzUserList.__lt__cCs|j||kSr%rrsr!r!r"__le__-rzUserList.__le__cCs|j||kSr%rrsr!r!r"ro.rzUserList.__eq__cCs|j||kSr%rrsr!r!r"__gt__/rzUserList.__gt__cCs|j||kSr%rrsr!r!r"__ge__0rzUserList.__ge__cCst|tr|jS|Sr%)rnrrrsr!r!r"__cast1szUserList.__castcCs ||jkSr%r r*r r!r!r"r3rzUserList.__contains__cCs t|jSr%r r)r!r!r"r4rzUserList.__len__cCs(t|tr||j|S|j|SdSr%)rnslicerbrr*ir!r!r"r5s zUserList.__getitem__cCs||j|<dSr%r r*rr r!r!r"rD:rzUserList.__setitem__cCs |j|=dSr%r rr!r!r"rH;rzUserList.__delitem__cCsPt|tr||j|jSt|t|jr<||j|S||jt|Sr%rnrrbrrrcrsr!r!r"r<s  zUserList.__add__cCsPt|tr||j|jSt|t|jr<|||jS|t||jSr%r rsr!r!r"__radd__Bs  zUserList.__radd__cCsRt|tr|j|j7_n2t|t|jr<|j|7_n|jt|7_|Sr%)rnrrrrcrsr!r!r"rHs  zUserList.__iadd__cCs||j|Sr%rbrrr!r!r"__mul__PszUserList.__mul__cCs|j|9_|Sr%r rr!r!r"__imul__SszUserList.__imul__cCs8|j|j}|j|j|jddd|jd<|Sr)rbrrUrvrr!r!r"rVszUserList.__copy__cCs|j|dSr%)rappendrr!r!r"r%\rzUserList.appendcCs|j||dSr%)rinsertrr!r!r"r&]rzUserList.insertrcCs |j|Sr%)rrErr!r!r"rE^rz UserList.popcCs|j|dSr%)rremoverr!r!r"r'_rzUserList.removecCs|jdSr%)rrKr)r!r!r"rK`rzUserList.clearcCs ||Sr%rjr)r!r!r"rfarz UserList.copycCs |j|Sr%)rrrr!r!r"rbrzUserList.countcGs|jj|f|Sr%rr)r*r rr!r!r"rcrzUserList.indexcCs|jdSr%)rrr)r!r!r"rdrzUserList.reversecOs|jj||dSr%)rsortr*rr>r!r!r"r)erz UserList.sortcCs*t|tr|j|jn |j|dSr%)rnrrextendrsr!r!r"r+fs zUserList.extend)N)r)#rr-r.rtr@rdrrrorrrrrrrDrHrr!rr#__rmul__r$rr%r&rEr'rKrfrrrr)r+r!r!r!r"rs@  c@sheZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&ZeZd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1ejfd2d3Zdd6d7Zd1ejfd8d9Z dd;d<Z!d1ejfd=d>Z"d?d@Z#dAdBZ$d1ejfdCdDZ%dEdFZ&dGdHZ'dIdJZ(dKdLZ)dMdNZ*dOdPZ+dQdRZ,dSdTZ-dUdVZ.dWdXZ/dYdZZ0d[d\Z1d]d^Z2d_d`Z3dadbZ4ddddeZ5e6j7Z7dfdgZ8ddidjZ9d1ejfdkdlZ:d1ejfdmdnZ;dodpZddudvZ?ddwdxZ@ddzd{ZAd1ejfd|d}ZBdd~dZCddZDddZEddZFddZGddZHdcS)rcCs<t|tr||_n&t|tr.|jdd|_n t||_dSr%)rnrrrr*seqr!r!r"r@ss   zUserString.__init__cCs t|jSr%)rrr)r!r!r"__str__zrzUserString.__str__cCs t|jSr%r r)r!r!r"rd{rzUserString.__repr__cCs t|jSr%)intrr)r!r!r"__int__|rzUserString.__int__cCs t|jSr%)floatrr)r!r!r" __float__}rzUserString.__float__cCs t|jSr%)complexrr)r!r!r" __complex__~rzUserString.__complex__cCs t|jSr%)hashrr)r!r!r"__hash__rzUserString.__hash__cCs|jddfSr%r r)r!r!r"rszUserString.__getnewargs__cCs t|tr|j|jkS|j|kSr%rnrrr*stringr!r!r"ros  zUserString.__eq__cCs t|tr|j|jkS|j|kSr%r8r9r!r!r"rs  zUserString.__lt__cCs t|tr|j|jkS|j|kSr%r8r9r!r!r"rs  zUserString.__le__cCs t|tr|j|jkS|j|kSr%r8r9r!r!r"rs  zUserString.__gt__cCs t|tr|j|jkS|j|kSr%r8r9r!r!r"rs  zUserString.__ge__cCst|tr|j}||jkSr%r8)r*charr!r!r"rs zUserString.__contains__cCs t|jSr%r r)r!r!r"rrzUserString.__len__cCs||j|Sr%r")r*rr!r!r"rrzUserString.__getitem__cCsJt|tr||j|jSt|tr6||j|S||jt|Sr%)rnrrbrrrsr!r!r"rs   zUserString.__add__cCs.t|tr|||jS|t||jSr%)rnrrbrrsr!r!r"r!s zUserString.__radd__cCs||j|Sr%r"rr!r!r"r#szUserString.__mul__cCs||j|Sr%r"r*rr!r!r"rszUserString.__mod__cCs|t||Sr%)rbr)r*templater!r!r"__rmod__szUserString.__rmod__cCs||jSr%)rbr capitalizer)r!r!r"r?rzUserString.capitalizecCs||jSr%)rbrcasefoldr)r!r!r"r@szUserString.casefoldcGs||jj|f|Sr%)rbrcenterr*widthrr!r!r"rAszUserString.centerr cCs t|tr|j}|j|||Sr%)rnrrrr*substartendr!r!r"rs zUserString.countutf-8strictcCs.|dkr dn|}|dkrdn|}|j||S)NrHrI)rencode)r*encodingerrorsr!r!r"rJszUserString.encodecCs|j|||Sr%)rendswith)r*suffixrFrGr!r!r"rMszUserString.endswithcCs||j|Sr%)rbr expandtabs)r*tabsizer!r!r"rPszUserString.expandtabscCs t|tr|j}|j|||Sr%)rnrrfindrDr!r!r"rRs zUserString.findcOs|jj||Sr%)rrr*r!r!r"rszUserString.formatcCs |j|Sr%)r format_map)r*rr!r!r"rSszUserString.format_mapcCs|j|||Sr%r(rDr!r!r"rszUserString.indexcCs |jSr%)risalphar)r!r!r"rTrzUserString.isalphacCs |jSr%)risalnumr)r!r!r"rUrzUserString.isalnumcCs |jSr%)risasciir)r!r!r"rVrzUserString.isasciicCs |jSr%)r isdecimalr)r!r!r"rWrzUserString.isdecimalcCs |jSr%)risdigitr)r!r!r"rXrzUserString.isdigitcCs |jSr%)rrr)r!r!r"rrzUserString.isidentifiercCs |jSr%)rislowerr)r!r!r"rYrzUserString.islowercCs |jSr%)r isnumericr)r!r!r"rZrzUserString.isnumericcCs |jSr%)r isprintabler)r!r!r"r[rzUserString.isprintablecCs |jSr%)risspacer)r!r!r"r\rzUserString.isspacecCs |jSr%)ristitler)r!r!r"r]rzUserString.istitlecCs |jSr%)risupperr)r!r!r"r^rzUserString.isuppercCs |j|Sr%)rrr-r!r!r"rrzUserString.joincGs||jj|f|Sr%)rbrljustrBr!r!r"r_szUserString.ljustcCs||jSr%)rbrlowerr)r!r!r"r`rzUserString.lowerNcCs||j|Sr%)rbrlstripr*charsr!r!r"rarzUserString.lstripcCs |j|Sr%)r partitionr*sepr!r!r"rdszUserString.partitionrcCs6t|tr|j}t|tr |j}||j|||Sr%)rnrrrbr)r*oldnewmaxsplitr!r!r"rs   zUserString.replacecCs t|tr|j}|j|||Sr%)rnrrrfindrDr!r!r"rjs zUserString.rfindcCs|j|||Sr%)rrindexrDr!r!r"rkszUserString.rindexcGs||jj|f|Sr%)rbrrjustrBr!r!r"rlszUserString.rjustcCs |j|Sr%)r rpartitionrer!r!r"rmszUserString.rpartitioncCs||j|Sr%)rbrrstriprbr!r!r"rnszUserString.rstripcCs|j||Sr%)rrr*rfrir!r!r"rszUserString.splitcCs|j||Sr%)rrsplitror!r!r"rpszUserString.rsplitFcCs |j|Sr%)r splitlines)r*keependsr!r!r"rqrzUserString.splitlinescCs|j|||Sr%)rr)r*prefixrFrGr!r!r"rszUserString.startswithcCs||j|Sr%)rbrstriprbr!r!r"rtrzUserString.stripcCs||jSr%)rbrswapcaser)r!r!r"rurzUserString.swapcasecCs||jSr%)rbrtitler)r!r!r"rvrzUserString.titlecGs||jj|Sr%)rbr translater<r!r!r"rwszUserString.translatecCs||jSr%)rbrupperr)r!r!r"rxrzUserString.uppercCs||j|Sr%)rbrzfill)r*rCr!r!r"ryrzUserString.zfill)rHrI)rO)N)r)N)Nr)Nr)F)N)Irr-r.r@r/rdr1r3r5r7rrorrrrrrrrr!r#r,rr>r?r@rArRmaxsizerrJrMrPrRrrSrrTrUrVrWrXrrYrZr[r\r]r^rr_r`rar maketransrdrrjrkrlrmrnrrprqrrtrurvrwrxryr!r!r!r"rrs         )7rtrroperatorr r~r rrkeywordr rsysrRheapqr_weakrefrr: itertoolsrrrrrrreprlibrry _collectionsr ImportErrorMutableSequenceregisterrr#KeysViewr$ ItemsViewr/ ValuesViewr2rxr3rLrr{rrrrur rrSequencerr!r!r!r"sh     Y&}nMSlib64/python3.8/ensurepip/__pycache__/__init__.cpython-38.pyc000064400000013166152352721540017664 0ustar00U &.eb@sddlZddlZddlZddlZddlZddlZddlZddlZddgZ dZ dZ iZ ddZ e dZe d Zded fd ed fgZdd d Zd dZddZdddddddddZdddddddddZddddZdddZdS)Nversion bootstrap) setuptoolspipz/usr/share/python38-wheels/cCstjtd|}it|<dD]J}d||}t|D].}|t|t| }tj|t||<q:q t t t|t j j dS)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})key)ospathjoin _WHEEL_DIRformat_wheelsgloblenbasenamestrmax distutilsrZ LooseVersion)ZpkgprefixsuffixpatternrZ version_strr*/usr/lib64/python3.8/ensurepip/__init__.py_get_most_recent_wheel_versions rrrZpy3cCsFd|pgd|d}tjd|g}tjjr6|ddtj|ddjS) Nz$ import runpy import sys sys.path = z + sys.path sys.argv[1:] = z> runpy.run_module("pip", run_name="__main__", alter_sys=True) z-cz-IT)Zcheck)sys executableflagsisolatedinsert subprocessrun returncode)argsadditional_pathscodecmdrrr_run_pip's  r&cCstS)zA Returns a string specifying the bundled version of pip. ) _PIP_VERSIONrrrrr;scCs2ddtjD}|D] }tj|=qtjtjd<dS)NcSsg|]}|dr|qS)ZPIP_) startswith).0krrr Es z7_disable_pip_configuration_settings..ZPIP_CONFIG_FILE)renvirondevnull)Zkeys_to_remover*rrr#_disable_pip_configuration_settingsAs r.Frootupgradeuser altinstall default_pip verbositycCst||||||ddS)z Bootstrap pip into the current Python installation (or the given root directory). Note that calling this function will alter both sys.path and os.environ. r/N) _bootstrapr/rrrrMs c CsP|r|rtdtd|t|r2dtjd<n|s@dtjd<t}g}tD]x\}} } t || } t tj t | d4} t tj || d} | | W5QRXW5QRX|tj || qTddd d |g}|r|d |g7}|r|d g7}|r |d g7}|r"|dd|g7}t|ddtD|W5QRSQRXdS)z Bootstrap pip into the current Python installation (or the given root directory). Returns pip command status code. Note that calling this function will alter both sys.path and os.environ. z.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstallrbwbz--no-cache-dirz --no-indexz --find-links--root --upgrade--user-vcSsg|] }|dqSrrr)prrrr+sz_bootstrap..N) ValueErrorrauditr.rr,tempfileZTemporaryDirectory _PROJECTSr openrr r writereadappendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ wheel_nameZsfpfpr"rrrr6\s4      "   r6)r5cCsz ddl}Wntk r"YdSX|jtkrNd}t||jttjddStdddg}|rt|dd |g7}t |d d t t DS) z~Helper to support a clean default uninstall process on Windows Note that calling this function may alter os.environ. rNzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))fileZ uninstallz-yz--disable-pip-version-checkr<r=cSsg|] }|dqSr>rr?rrrr+sz%_uninstall_helper..) r ImportError __version__r'printr rstderrr.r&reversedrD)r5rmsgr"rrr_uninstall_helpers   rQcCsddl}|jdd}|jdddtdd|jd d d dd d d|jdddddd|jddddd|jdddd|jddddd|jddddd||}t|j|j|j |j |j |j dS)Nrzpython -m ensurepip)progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)actionrhelpz-vz --verbosecountr5zDGive more output. Option is additive, and can be used up to 3 times.)rSdefaultdestrTz-Ur: store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz --altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z --default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r0r1r2r5r3r4) argparseArgumentParser add_argumentr r parse_argsr6r0r1r2r5r3r4)argvrYparserr"rrr_mainsn   r_)N)N)Zdistutils.versionrr rZos.pathrZrunpyrCr__all__Z_PACKAGE_NAMESr r rZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrrs@     6usr/lib64/python3.8/asyncio/__pycache__/__init__.cpython-38.pyc000064400000001360152353025710020116 0ustar00U e5d@sdZddlZddlTddlTddlTddlTddlTddlTddlTddl Tddl Tddl Tddl Tddl TddlTddl mZejejejejejejeje je je je je jejZejdkrddlTeej7ZnddlTeej7ZdS)z'The asyncio package, tracking PEP 3156.N)*)_all_tasks_compatZwin32)__doc__sysZ base_eventsZ coroutinesZevents exceptionsZfuturesZlocksZ protocolsZrunnersZqueuesZstreams subprocessZtasksZ transportsr__all__platformZwindows_eventsZ unix_eventsr r (/usr/lib64/python3.8/asyncio/__init__.pysZ       lib64/python3.8/email/__pycache__/__init__.cpython-38.pyc000064400000003235152360560560016737 0ustar00U e5d@sNdZddddddddd d d d d ddddgZdd Zdd Zdd Zdd ZdS)z?A package for parsing, handling, and generating email messages.Z base64mimecharsetZencoderserrorsZ feedparser generatorheaderZ iteratorsmessagemessage_from_filemessage_from_binary_filemessage_from_stringmessage_from_bytesZmimeparserZ quoprimimeZutilscOsddlm}||||S)zvParse a string into a Message object model. Optional _class and strict are passed to the Parser constructor. Parser) email.parserr Zparsestr)sargskwsr r&/usr/lib64/python3.8/email/__init__.pyr s cOsddlm}||||S)z|Parse a bytes string into a Message object model. Optional _class and strict are passed to the Parser constructor. r  BytesParser)rrZ parsebytes)rrrrrrrr (s cOsddlm}||||S)zRead a file and parse its contents into a Message object model. Optional _class and strict are passed to the Parser constructor. r r )rr parse)fprrr rrrr0s cOsddlm}||||S)zRead a binary file and parse its contents into a Message object model. Optional _class and strict are passed to the Parser constructor. r r)rrr)rrrrrrrr8s N)__doc____all__rr rrrrrrs,lib64/python3.8/json/__pycache__/__init__.cpython-38.pyc000064400000030502152360637500016615 0ustar00U e5d 8 @sdZdZdddddddgZd Zd d lmZmZd d lmZd dl Z eddddddddZ dddddddddd ddZ dddddddddd ddZ edddZ ddZdddddddddZdddddddddZdS)a JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally maintained simplejson library. Encoding basic Python object hierarchies:: >>> import json >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) '["foo", {"bar": ["baz", null, 1.0, 2]}]' >>> print(json.dumps("\"foo\bar")) "\"foo\bar" >>> print(json.dumps('\u1234')) "\u1234" >>> print(json.dumps('\\')) "\\" >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) {"a": 0, "b": 0, "c": 0} >>> from io import StringIO >>> io = StringIO() >>> json.dump(['streaming API'], io) >>> io.getvalue() '["streaming API"]' Compact encoding:: >>> import json >>> mydict = {'4': 5, '6': 7} >>> json.dumps([1,2,3,mydict], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: >>> import json >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) { "4": 5, "6": 7 } Decoding JSON:: >>> import json >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj True >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' True >>> from io import StringIO >>> io = StringIO('["streaming API"]') >>> json.load(io)[0] == 'streaming API' True Specializing JSON object decoding:: >>> import json >>> def as_complex(dct): ... if '__complex__' in dct: ... return complex(dct['real'], dct['imag']) ... return dct ... >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) >>> from decimal import Decimal >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') True Specializing JSON object encoding:: >>> import json >>> def encode_complex(obj): ... if isinstance(obj, complex): ... return [obj.real, obj.imag] ... raise TypeError(f'Object of type {obj.__class__.__name__} ' ... f'is not JSON serializable') ... >>> json.dumps(2 + 1j, default=encode_complex) '[2.0, 1.0]' >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' Using json.tool from the shell to validate and pretty-print:: $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name enclosed in double quotes: line 1 column 3 (char 2) z2.0.9dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r r clsrrr sort_keysc  Ks|sD|rD|rD|rD|dkrD|dkrD|dkrD| dkrD| sD| sDt|} n2|dkrPt}|f||||||| | d| |} | D]} || qzdS)aSerialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the strings written to ``fp`` can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr r r r rrrr)_default_encoder iterencoderwrite)objfpr r r r rrrrrkwiterablechunkr%/usr/lib64/python3.8/json/__init__.pyrxsD- c Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB| sB| sBt|S|dkrNt}|f|||||||| d| |S)auSerialize ``obj`` to a JSON formatted ``str``. If ``skipkeys`` is true then ``dict`` keys that are not basic types (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped instead of raising a ``TypeError``. If ``ensure_ascii`` is false, then the return value can contain non-ASCII characters if they appear in strings contained in ``obj``. Otherwise, all such characters are escaped in JSON strings. If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. ``None`` is the most compact representation. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', ': ')`` otherwise. To get the most compact JSON representation, you should specify ``(',', ':')`` to eliminate whitespace. ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. If *sort_keys* is true (default: ``False``), then the output of dictionaries will be sorted by key. To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the ``.default()`` method to serialize additional types), specify it with the ``cls`` kwarg; otherwise ``JSONEncoder`` is used. Nr)rencoder) rr r r r rrrrrrrrrrsD, ) object_hookobject_pairs_hookcCs|j}|tjtjfrdS|tjtjfr.dS|tjrrrrr+sT$     )__doc__ __version____all__ __author__decoderrrencoderrr%rrrrAr-rrrrrrsda   ? :  lib64/python3.8/xml/sax/__pycache__/__init__.cpython-38.pyc000064400000006225152361670310017241 0ustar00U e5d?@s dZddlmZddlmZmZddlmZmZm Z m Z m Z efddZ efddZ d gZd Zernd d lZd d lZd d lZejjsd ejkrejd d Z[dZejd ddkrejerejed ZdddZejd ddkrddZnddZ[d S)aSimple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modules: handler -- Base classes and constants which define the SAX 2 API for the 'client-side' of SAX for Python. saxutils -- Implementation of the convenience classes commonly used to work with SAX. xmlreader -- Base classes and constants which define the SAX 2 API for the parsers used with SAX for Python. expatreader -- Driver that allows use of the Expat parser with SAX. ) InputSource)ContentHandler ErrorHandler) SAXExceptionSAXNotRecognizedExceptionSAXParseExceptionSAXNotSupportedExceptionSAXReaderNotAvailablecCs(t}||||||dS)N) make_parsersetContentHandlersetErrorHandlerparse)sourcehandler errorHandlerparserr(/usr/lib64/python3.8/xml/sax/__init__.pyr s  r cCspddl}|dkrt}t}||||t}t|trR|| |n| | || |dS)N) iorr r r r isinstancestrZsetCharacterStreamStringIOZ setByteStreamBytesIOr )stringrrrrZinpsrcrrr parseString#s   rzxml.sax.expatreaderrNZ PY_SAX_PARSER,zpython.xml.sax.parserjavarc Csxt|tD]\}zt|WStk rT}zddl}||jkrDW5d}~XYq tk rfYq Xq tdddS)a3Creates and returns a SAX parser. Creates the first parser it is able to instantiate of the ones given in the iterable created by chaining parser_list and default_parser_list. The iterables must contain the names of Python modules containing both a SAX parser and a create_parser function.rNzNo parsers found)listdefault_parser_list_create_parser ImportErrorsysmodulesr )Z parser_list parser_nameer#rrrr Fs r cCs$ddlm}||dt}|S)Nr)imp)Zorg.python.corer'Z importNameglobals create_parser)r%r' drv_modulerrrr!as r!cCst|iidg}|S)Nr)) __import__r))r%r*rrrr!gs)r)__doc__Z xmlreaderrrrr _exceptionsrrrrr r rr _falseZxml.sax.expatreaderZxmlosr#flagsignore_environmentenvironsplitZ_keyplatformregistryZ containsKeyZ getPropertyr r!rrrrs*   lib64/python3.8/xml/__pycache__/__init__.cpython-38.pyc000064400000001266152362575770016465 0ustar00U e5d-@sdZddddgZdS)aCore XML support for Python. This package contains four sub-packages: dom -- The W3C Document Object Model. This supports DOM Level 1 + Namespaces. parsers -- Python wrappers for XML parsers (currently only supports Expat). sax -- The Simple API for XML, developed by XML-Dev, led by David Megginson and ported to Python by Lars Marius Garshol. This supports the SAX 2 API. etree -- The ElementTree XML library. This is a subset of the full ElementTree XML release. ZdomZparsersZsaxZetreeN)__doc____all__rr$/usr/lib64/python3.8/xml/__init__.pyslib64/python3.8/ctypes/macholib/__pycache__/__init__.cpython-38.pyc000064400000000455152363467130020740 0ustar00U e5d@s dZdZdS)z~ Enough Mach-O to make your head spin. See the relevant header files in /usr/include/mach-o And also Apple's documentation. z1.0N)__doc__ __version__rr0/usr/lib64/python3.8/ctypes/macholib/__init__.pyslib64/python3.8/tkinter/__pycache__/__init__.cpython-38.pyc000064400000530121152364016740017327 0ustar00U e5d͕@sdZddlZddlZddlZejZddlTddlZdZeej Z eej Z ej Z ejZejZedZedejZddZd d Zd d Zz ejZWnek rYnXd dZz ejZWnek rYnXdyddZGdddeejZGdddZdadaddZ dzddZ!ddZ"d{ddZ#da$GdddZ%Gd d!d!e%Z&Gd"d#d#e%Z'Gd$d%d%e%Z(Gd&d'd'e%Z)d|d(d)Z*e+Z,eZ-d*d+Z.Gd,d-d-Z/Gd.d/d/Z0Gd0d1d1Z1Gd2d3d3Z2Gd4d5d5Z3Gd6d7d7e/e3Z4d}d8d9Z5Gd:d;d;Z6Gdd?d?Z8Gd@dAdAe/Z9GdBdCdCe9e6e7e8Z:GdDdEdEe9e3Z;GdFdGdGe:ZGdLdMdMe:e1Z?GdNdOdOe:Z@GdPdQdQe:ZAGdRdSdSe:e1e2ZBGdTdUdUe:ZCGdVdWdWe:ZDGdXdYdYe:ZEGdZd[d[e:ZFGd\d]d]e:ZGGd^d_d_e:ZHGd`dadae:e1e2ZIGdbdcdcZJGdddedeeDZKGdfdgdgZLGdhdidieLZMGdjdkdkeLZNdldmZOdndoZPGdpdqdqe:e1ZQGdrdsdse:ZRGdtdudue:ZSdvdwZTeUdxkreTdS)~a8Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWindow. Properties of the widgets are specified with keyword arguments. Keyword arguments have the same name as the corresponding resource under Tk. Widgets are positioned with one of the geometry managers Place, Pack or Grid. These managers can be called with methods place, pack, grid available in every Widget. Actions are bound to events by resources (e.g. keyword argument command) or with the method bind. Example (Hello, World): import tkinter from tkinter.constants import * tk = tkinter.Tk() frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2) frame.pack(fill=BOTH,expand=1) label = tkinter.Label(frame, text="Hello, World") label.pack(fill=X, expand=1) button = tkinter.Button(frame,text="Exit",command=tk.destroy) button.pack(side=BOTTOM) tk.mainloop() N)*z([\\{}])z([\s])cCsdtt|S)Internal function. )joinmap _stringifyvaluer (/usr/lib64/python3.8/tkinter/__init__.py_join8sr cCst|ttfrHt|dkr:t|d}t|rFd|}qdt|}ntt|}|sZd}nbt|rt d|}| dd}t d|}|ddkrd |}n|ddkst |rd|}|S) rrrz{%s}z{}z\\\1 z\n"\) isinstancelisttuplelenr _magic_researchr strsubreplace _space_rer r r r r=s$          rcCs@d}|D]2}t|ttfr(|t|}q|dk r||f}q|S)rr N)rrr_flatten)seqresitemr r r rVs rc Cst|tr|St|tdtfr$|Si}t|D]^}z||Wq0ttfk r}z(td|| D]\}}|||<qjW5d}~XYq0Xq0|SdS)rNz_cnfmerge: fallback due to:) rdicttyperrupdateAttributeError TypeErrorprintitems)Zcnfscnfcmsgkvr r r _cnfmergees   r+Tc Csz||}t|drtdt|}i}t||D]@\}}t|}|r`|ddkr`|dd}|rl||}|||<q4|S)aReturn a properly formatted dict built from Tcl list pairs. If cut_minus is True, the supposed '-' prefix will be removed from keys. If conv is specified, it is used to convert values. Tcl list is expected to contain an even number of elements. zNTcl list representing a dict is expected to contain an even number of elementsr-rN) splitlistr RuntimeErroriterzipr) tkr*Z cut_minusconvtitrkeyr r r r _splitdict{s    r7c@seZdZdZeZdZdZeZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)e*j+Z+d&S)' EventType23456789Z10Z11Z12Z13Z14Z15Z16Z17Z18Z19Z20Z21Z22Z23Z24Z25Z26Z27Z28Z29Z30Z31Z32Z33Z34Z35Z36Z37Z38N),__name__ __module__ __qualname__ZKeyPressZKeyZ KeyReleaseZ ButtonPressButtonZ ButtonReleaseZMotionZEnterZLeaveZFocusInZFocusOutZKeymapZExposeZGraphicsExposeZNoExposeZ VisibilityZCreateZDestroyZUnmapZMapZ MapRequestZReparentZ ConfigureZConfigureRequestZGravityZ ResizeRequestZ CirculateZCirculateRequestZPropertyZSelectionClearZSelectionRequestZ SelectionZColormapZ ClientMessageMappingZ VirtualEventZActivateZ DeactivateZ MouseWheelr__str__r r r r r8sPr8c@seZdZdZddZdS)EventaContainer for the properties of an event. Instances of this type are generated if one of the following events occurs: KeyPress, KeyRelease - for keyboard events ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate, Colormap, Gravity, Reparent, Property, Destroy, Activate, Deactivate - for window events. If a callback function for one of these events is registered using bind, bind_all, bind_class, or tag_bind, the callback is called with an Event as first argument. It will have the following attributes (in braces are the event types for which the attribute is valid): serial - serial number of event num - mouse button pressed (ButtonPress, ButtonRelease) focus - whether the window has the focus (Enter, Leave) height - height of the exposed window (Configure, Expose) width - width of the exposed window (Configure, Expose) keycode - keycode of the pressed key (KeyPress, KeyRelease) state - state of the event as a number (ButtonPress, ButtonRelease, Enter, KeyPress, KeyRelease, Leave, Motion) state - state as a string (Visibility) time - when the event occurred x - x-position of the mouse y - y-position of the mouse x_root - x-position of the mouse on the screen (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion) y_root - y-position of the mouse on the screen (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion) char - pressed character (KeyPress, KeyRelease) send_event - see X/Windows documentation keysym - keysym of the event as a string (KeyPress, KeyRelease) keysym_num - keysym of the event as a number (KeyPress, KeyRelease) type - type of the event as a number widget - widget in which the event occurred delta - delta of wheel movement (MouseWheel) csdd|jD|js"d=n|jdkr:t|jd<t|ddsLd=|jdkr^d=n|t|jtr|j}d }g}t|D]\}}|d |>@r| |q|d t |>d @}|s|s| t |d |d<|j dkrd =d }dt|jd|jd fdd|DfS)NcSsi|]\}}|dkr||qS)??r .0r)r*r r r sz"Event.__repr__..charrH send_eventTrstate) ZShiftZLockZControlZMod1ZMod2ZMod3ZMod4ZMod5ZButton1ZButton2ZButton3ZButton4ZButton5r|delta) rMrNkeysymkeycoderLnumrPfocusxywidthheightz <%s event%s>namec3s&|]}|krd||fVqdS)z %s=%sNr )rJr)attrsr r sz!Event.__repr__..)__dict__r%rLreprgetattrrNrint enumerateappendrhexrrPr )selfrNZmodssinkeysr r[r __repr__s6       zEvent.__repr__N)rArBrC__doc__rjr r r r rGs*rGcCsdadabdS)zInhibit setting of default root window. Call this function to inhibit that the first instance of Tk is used for windows without an explicit parent window. FN)_support_default_root _default_rootr r r r NoDefaultRootsrncCs:ts tdts6|r$td|dt}t|ks6ttS)NzINo master specified and tkinter is configured to not support default rootz Too early to z: no default root window)rlr/rmTkAssertionError)whatrootr r r _get_default_root#s rscCsdSrNr )errr r r _tkerror/srvcCs.z t|}Wntk r YnXt|dS)zBInternal function. Calling it will raise the exception SystemExit.N)ra ValueError SystemExit)coder r r _exit4s  rzc@seZdZdZdZdZdZdddZddZdd Z d d Z e Z d d Z ddZ ddZddZddZddZeZddZddZddZdS)VariablezClass to define value holders for e.g. buttons. Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations that constrain the type of the value returned from get().rZNcCs|dk rt|tstd|s&td}||_|j|_|rD||_ndtt |_t d7a |dk rn| |n&|j |j dd|js| |j dS)a.Construct a variable MASTER can be given as master widget. VALUE is an optional value (defaults to "") NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. Nzname must be a stringzcreate variablePY_VARrinfoexists)rrr#rs_rootr2_tk_namer__varnum initialize getbooleancall_defaultremasterr rYr r r __init__Is   zVariable.__init__cCsb|jdkrdS|j|jdd|jr6|j|j|jdk r^|jD]}|j|qFd|_dS)zUnset the variable in Tcl.Nr}r~)rrrrZglobalunsetvar _tclCommands deletecommandrerYr r r __del__gs   zVariable.__del__cCs|jS)z'Return the name of the variable in Tcl.)rrer r r rFsszVariable.__str__cCs|j|j|SzSet the variable to VALUE.)r globalsetvarrrer r r r setwsz Variable.setcCs|j|jS)zReturn value of variable.)r globalgetvarrrr r r get}sz Variable.getcCst|d|jj}tt|}z |j}Wntk r:YnXz||j}Wntk r^YnX|j |||j dkr~g|_ |j ||SN) CallWrapperr__call__r_id__func__r"rAr createcommandrrc)recallbackfcbnamer r r _registers    zVariable._registercCs(||}|jddd|j||f|S)a#Define a trace callback for the variable. Mode is one of "read", "write", "unset", or a list or tuple of such strings. Callback must be a function which is called when the variable is read, written or unset. Return the name of the callback. traceaddvariablerrrrremoderrr r r trace_adds  zVariable.trace_addcCsx|jddd|j|||D] \}}|j|d|kr qtq |j|z|j|Wntk rrYnXdS)aDelete the trace callback for a variable. Mode is one of "read", "write", "unset" or a list or tuple of such strings. Must be same as were specified in trace_add(). cbname is the name of the callback returned from trace_add(). rremoverrN) rrr trace_infor.rrrrwrerrmZcar r r trace_removes  zVariable.trace_removec s4|jjfddt|jddd|jDS)z&Return all trace callback information.csg|]\}}||fqSr r rIr.r r sz'Variable.trace_info..rr}r)rr.rrrrr rr rszVariable.trace_infocCs$||}|jdd|j|||S)aDefine a trace callback for the variable. MODE is one of "r", "w", "u" for read, write, undefine. CALLBACK must be a function which is called when the variable is read, written or undefined. Return the name of the callback. This deprecated method wraps a deprecated Tcl method that will likely be removed in the future. Use trace_add() instead. rrrrr r r trace_variables zVariable.trace_variablecCs|jdd|j|||j|d}|D] \}}|j|d|kr.qq.|j|z|j|Wntk rYnXdS)aSDelete the trace callback for a variable. MODE is one of "r", "w", "u" for read, write, undefine. CBNAME is the name of the callback returned from trace_variable or trace. This deprecated method wraps a deprecated Tcl method that will likely be removed in the future. Use trace_remove() instead. rZvdeleterN) rrrr.rrrrrwrr r r trace_vdeletes  zVariable.trace_vdeletecs(fddjjddjDS)zReturn all trace callback information. This deprecated method wraps a deprecated Tcl method that will likely be removed in the future. Use trace_info() instead. csg|]}j|qSr )rr.rJrUrr r rsz(Variable.trace_vinfo..rZvinfo)rr.rrrr rr trace_vinfoszVariable.trace_vinfocCs6t|tstS|j|jko4|jj|jjko4|j|jkSr)rr{NotImplementedr __class__rAr)reotherr r r __eq__s   zVariable.__eq__)NNN)rArBrCrkrrrrrrFrrrrrrrrrrrrr r r r r{@s&   r{c@s&eZdZdZdZdddZddZdS) StringVarz#Value holder for strings variables.rZNcCst||||dS)a6Construct a string variable. MASTER can be given as master widget. VALUE is an optional value (defaults to "") NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. Nr{rrr r r rs zStringVar.__init__cCs$|j|j}t|tr|St|S)z#Return value of variable as string.)rrrrrrr r r rs z StringVar.get)NNNrArBrCrkrrrr r r r rs rc@s&eZdZdZdZdddZddZdS) IntVarz#Value holder for integer variables.rNcCst||||dS)a7Construct an integer variable. MASTER can be given as master widget. VALUE is an optional value (defaults to 0) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. Nrrr r r rs zIntVar.__init__c CsJ|j|j}z|j|WSttfk rDt|j|YSXdS)z/Return the value of the variable as an integer.N)rrrgetintr#TclErrorra getdoublerr r r rs z IntVar.get)NNNrr r r r r s rc@s&eZdZdZdZdddZddZdS) DoubleVarz!Value holder for float variables.gNcCst||||dS)a6Construct a float variable. MASTER can be given as master widget. VALUE is an optional value (defaults to 0.0) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. Nrrr r r r*s zDoubleVar.__init__cCs|j|j|jS)z,Return the value of the variable as a float.)rrrrrr r r r6sz DoubleVar.get)NNNrr r r r r&s rc@s2eZdZdZdZd ddZddZeZdd ZdS) BooleanVarz#Value holder for boolean variables.FNcCst||||dS)a:Construct a boolean variable. MASTER can be given as master widget. VALUE is an optional value (defaults to False) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. Nrrr r r r?s zBooleanVar.__init__cCs|j|j|j|Sr)rrrrrr r r rKszBooleanVar.setcCs:z|j|j|jWStk r4tdYnXdS)z+Return the value of the variable as a bool. invalid literal for getboolean()N)rrrrrrwrr r r rQszBooleanVar.get)NNN) rArBrCrkrrrrrr r r r r;s  rcCstdj|dS)zRun the main loop of Tcl.zrun the main loopN)rsr2mainloop)rhr r r rYsrcCs4ztdj|WStk r.tdYnXdS)z$Convert Tcl object to True or False.zuse getboolean()rN)rsr2rrrwrfr r r rcsrc@seZdZdZdZdZddZddZd1ddZd d Z d d Z d2ddZ e Z d3ddZ d4ddZd5ddZd6ddZddZddZddZdd ZeZd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd7d/d0Zd1d2Zd3d4Zd8d6d7Z d8d9Z!d:d;Z"dd?Z$d@dAZ%dBdCZ&dDdEZ'dFdGZ(d9dHdIZ)dJdKZ*dLdMZ+d:dNdOZ,dPdQZ-dRdSZ.dTdUZ/dVdWZ0dXdYZ1dZd[Z2d;d\d]Z3ddbdcZ7dddeZ8dfdgZ9dhdiZ:djdkZ;d?dldmZdrdsZ?dtduZ@dvdwZAdxdyZBd@dzd{ZCd|d}ZDd~dZEddZFddZGdAddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^dBddZ_ddZ`ddZaddZbddZcddZdddZedd„ZfddĄZgddƄZhddȄZiddʄZjdCdd̄ZkdDddτZldEddфZmdFddӄZndGddՄZoddׄZpdHddلZqddۄZrdIdd݄Zsdd߄ZtddZuddZvddZwddZxeyddZzdJddZ{ddZ|e|Z}dKddZ~e~ZddZdZdeZddZddZddZddZddZdLddZeZddZeZddZddZddZdd Zd gZefd d ZeZd dZeZddZdMddZeZdNddZeZddZddZifddZeZddZefddZifdd ZeZd!d"ZeZdOd#d$Zd%d&Zd'd(Zd)d*ZdPd+d,Zd-d.Zd/d0ZdS(QMisczRInternal class. Base class which defines methods common for interior widgets.NcCs,|jdk r(|jD]}|j|qd|_dS)zkInternal function. Delete all Tcl commands created for this widget in the Tcl interpreter.N)rr2rrr r r destroyxs  z Misc.destroycCs6|j|z|j|Wntk r0YnXdS)zDInternal function. Delete the Tcl command provided in NAME.N)r2rrrrwrr r r rs  zMisc.deletecommandcCs|j|jdd|S)zSet Tcl internal variable, whether the look and feel should adhere to Motif. A parameter of 1 means adhere to Motif (e.g. no color change if mouse passes over slider). Returns the set value.rtk_strictMotif)r2rrrebooleanr r r rs  zMisc.tk_strictMotifcCs|jddS)zDChange the color scheme to light brown as used in Tk 3.6 and before. tk_bisqueNr2rrr r r rszMisc.tk_bisquecOs(|jdt|tt|dS)a Set a new color scheme for all widget elements. A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The following keywords are valid: activeBackground, foreground, selectColor, activeForeground, highlightBackground, selectBackground, background, highlightColor, selectForeground, disabledForeground, insertBackground, troughColor.) tk_setPaletteN)r2rrrr%reargskwr r r rs zMisc.tk_setPaletter|cCs|jdd|dS)zWait until the variable is modified. A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.tkwaitrNrrr r r wait_variableszMisc.wait_variablecCs"|dkr |}|jdd|jdS)zQWait until a WIDGET is destroyed. If no parameter is given self is used.Nrwindowr2r_wrerr r r wait_windowszMisc.wait_windowcCs"|dkr |}|jdd|jdS)zxWait until the visibility of a WIDGET changes (e.g. it appears). If no parameter is given self is used.NrZ visibilityrrr r r wait_visibilityszMisc.wait_visibility1cCs|j||dS)zSet Tcl variable NAME to VALUE.N)r2setvar)rerYr r r r rsz Misc.setvarcCs |j|S)z"Return value of Tcl variable NAME.)r2getvarrr r r rsz Misc.getvarc CsBz|j|WStk r<}ztt|W5d}~XYnXdSr)r2rrrwrrerfexcr r r rsz Misc.getintc CsBz|j|WStk r<}ztt|W5d}~XYnXdSr)r2rrrwrrr r r rszMisc.getdoublecCs0z|j|WStk r*tdYnXdS)zPReturn a boolean value for Tcl boolean values true and false given as parameter.rN)r2rrrw)rerfr r r rszMisc.getbooleancCs|jd|jdS)zDirect input focus to this widget. If the application currently does not have the focus this widget will get the focus if the application gets the focus through the window manager.rTNrrr r r focus_setszMisc.focus_setcCs|jdd|jdS)ztDirect input focus to this widget even if the application does not have the focus. Use with caution!rTz-forceNrrr r r focus_forceszMisc.focus_forcecCs&|jd}|dks|sdS||S)zReturn the widget which has currently the focus in the application. Use focus_displayof to allow working with several displays. Return None if application does not have the focus.rTnoneN)r2r _nametowidgetrr r r focus_gets  zMisc.focus_getcCs,|jdd|j}|dks|s"dS||S)zReturn the widget which has currently the focus on the display where this widget is located. Return None if the application does not have the focus.rT -displayofrNr2rrrrr r r focus_displayofs zMisc.focus_displayofcCs,|jdd|j}|dks|s"dS||S)zyReturn the widget which would have the focus if top level for this widget gets the focus from the window manager.rTz-lastforrNrrr r r focus_lastfors zMisc.focus_lastforcCs|jddS)zXThe widget under mouse will get automatically focus. Can not be disabled easily.tk_focusFollowsMouseNrrr r r rszMisc.tk_focusFollowsMousecCs"|jd|j}|sdS||S)anReturn the next widget in the focus order which follows widget which has currently the focus. The focus order first goes to the next child, then to the children of the child recursively and then to the next sibling which is higher in the stacking order. A widget is omitted if it has the takefocus resource set to 0. tk_focusNextNrrr r r r s zMisc.tk_focusNextcCs"|jd|j}|sdS||S)zHReturn previous widget in the focus order. See tk_focusNext for details. tk_focusPrevNrrr r r rszMisc.tk_focusPrevcsNsjd|dSfdd}j|_|jd|SdS)aCall function once after given time. MS specifies the time in milliseconds. FUNC gives the function which shall be called. Additional parameters are given as parameters to the function call. Return identifier to cancel scheduling with after_cancel.afterNcs8z W5zWntk r0YnXXdSr)rrr rfuncrYrer r callit,s  zMisc.after..callit)r2rrAr)reZmsrrrr rr r s z Misc.aftercGs|jd|f|S)zCall FUNC once if the Tcl main loop has no event to process. Return an identifier to cancel the scheduling with after_cancel.Zidle)r)rerrr r r after_idle8szMisc.after_idlecCsd|s tdz.|jdd|}|j|d}||Wntk rNYnX|jdd|dS)zCancel scheduling of function identified with ID. Identifier returned by after or after_idle must be given as first parameter. z?id must be a valid identifier returned from after or after_idlerr}rZcancelN)rwr2rr.rr)rerdataZscriptr r r after_cancel@szMisc.after_cancelrcCs|jd||dS)zRing a display's bell.)bellN)r2r _displayofre displayofr r r rQsz Misc.bellcKsdd|krN|jdkrNz d|d<|jd||WStk rL|d=YnX|jd||S)aRetrieve data from the clipboard on window's display. The window keyword defaults to the root window of the Tkinter application. The type keyword specifies the form in which the data is to be returned and should be an atom name such as STRING or FILE_NAME. Type defaults to STRING, except on X11, where the default is to try UTF8_STRING and fall back to STRING. This command is equivalent to: selection_get(CLIPBOARD) r x11 UTF8_STRING) clipboardr)_windowingsystemr2r_optionsrrerr r r clipboard_getVs zMisc.clipboard_getcKs,d|kr|j|d<|jd||dS)zClear the data in the Tk clipboard. A widget specified for the optional displayof keyword argument specifies the target display.r)rclearNrr2rrrr r r clipboard_clearms zMisc.clipboard_clearcKs4d|kr|j|d<|jd||d|fdS)zAppend STRING to the Tk clipboard. A widget specified at the optional displayof keyword argument specifies the target display. The clipboard can be retrieved with selection_get.r)rrc--Nr)restringrr r r clipboard_appendus  zMisc.clipboard_appendcCs$|jdd|j}|sdS||S)zOReturn widget which has currently the grab in this application or None.grabZcurrentNrrr r r grab_currentszMisc.grab_currentcCs|jdd|jdS)z.Release grab for this widget if currently set.rreleaseNrrr r r grab_releaseszMisc.grab_releasecCs|jdd|jdS)zwSet grab for this widget. A grab directs all events to this and descendant widgets in the application.rrNrrr r r grab_setsz Misc.grab_setcCs|jddd|jdS)zSet global grab for this widget. A global grab directs all events to this and descendant widgets on the display. Use with caution - other applications do not get events anymore.rrz-globalNrrr r r grab_set_globalszMisc.grab_set_globalcCs"|jdd|j}|dkrd}|S)zYReturn None, "local" or "global" if this widget has no, a local or a global grab.rstatusrNr)rerr r r grab_statusszMisc.grab_statuscCs|jdd|||dS)zSet a VALUE (second parameter) for an option PATTERN (first parameter). An optional third parameter gives the numeric priority (defaults to 80).optionrNr)repatternr priorityr r r option_addszMisc.option_addcCs|jdddS)zPClear the option database. It will be reloaded if option_add is called.rrNrrr r r option_clearszMisc.option_clearcCs|jdd|j||S)zReturn the value for an option NAME for this widget with CLASSNAME. Values with higher priority override lower values.rrr)rerY classNamer r r option_getszMisc.option_getcCs|jdd||dS)zvRead file FILENAME into the option database. An optional second parameter gives the numeric priority.rZreadfileNr)reZfileNamerr r r option_readfileszMisc.option_readfilecKs,d|kr|j|d<|jd||dS)zClear the current X selection.r) selectionrNrrr r r selection_clears zMisc.selection_clearcKsvd|kr|j|d<d|kr`|jdkr`z d|d<|jd||WStk r^|d=YnX|jd||S)aReturn the contents of the current X selection. A keyword parameter selection specifies the name of the selection and defaults to PRIMARY. A keyword parameter displayof specifies a widget on the display to use. A keyword parameter type specifies the form of data to be fetched, defaulting to STRING except on X11, where UTF8_STRING is tried before STRING.rr rr)r r)rrr2rrrrr r r selection_gets   zMisc.selection_getcKs.||}|jd|||j|fdS)aSpecify a function COMMAND to call if the X selection owned by this widget is queried by another application. This function must return the contents of the selection. The function will be called with the arguments OFFSET and LENGTH which allows the chunking of very long selections. The following keyword parameters can be provided: selection - name of the selection (default PRIMARY), type - type of the selection (e.g. STRING, FILE_NAME).)r ZhandleN)rr2rrr)recommandrrYr r r selection_handles zMisc.selection_handlecKs"|jd|||jfdS)zBecome owner of X selection. A keyword parameter selection specifies the name of the selection (default PRIMARY).r ZownN)r2rrrrr r r selection_owns zMisc.selection_owncKs:d|kr|j|d<|jd||}|s0dS||S)zReturn owner of X selection. The following keyword parameter can be provided: selection - name of the selection (default PRIMARY), type - type of the selection (e.g. STRING, FILE_NAME).rrN)rr2rrr)rerrYr r r selection_own_gets  zMisc.selection_own_getcGs|jd||f|S)zDSend Tcl command CMD to different interpreter INTERP to be executed.sendr)reZinterpcmdrr r r rsz Misc.sendcCs|jd|j|dS)z(Lower this widget in the stacking order.lowerNr)re belowThisr r r rsz Misc.lowercCs|jd|j|dS)z(Raise this widget in the stacking order.raiseNr)re aboveThisr r r tkraisesz Misc.tkraisecCs(d|||f}|j|j|S)z*Return integer which represents atom NAME.)winfoZatom)rr2rr)rerYrrr r r winfo_atomszMisc.winfo_atomcCs d|||f}|j|S)z'Return name of atom with identifier ID.)rZatomnamerr2rrerrrr r r winfo_atomname s zMisc.winfo_atomnamecCs|j|jdd|jS)z7Return number of cells in the colormap for this widget.rZcellsr2rrrrr r r winfo_cellsszMisc.winfo_cellsc CsRg}|j|jdd|jD].}z|||Wqtk rJYqXq|S)z?Return a list of all widgets which are children of this widget.rchildren)r2r.rrrcrKeyError)reresultchildr r r winfo_childrenszMisc.winfo_childrencCs|jdd|jS)z(Return window class name of this widget.rclassrrr r r winfo_class#szMisc.winfo_classcCs|j|jdd|jS)z?Return True if at the last color request the colormap was full.rZ colormapfullr2rrrrr r r winfo_colormapfull'szMisc.winfo_colormapfullcCs4d||||f}|j|}|s*dS||S)z@Return the widget which is at the root coordinates ROOTX, ROOTY.)rZ containingN)rr2rr)reZrootXZrootYrrrYr r r winfo_containing,s zMisc.winfo_containingcCs|j|jdd|jS)z$Return the number of bits per pixel.rZdepthr!rr r r winfo_depth4szMisc.winfo_depthcCs|j|jdd|jS)z"Return true if this widget exists.rr~r!rr r r winfo_exists8szMisc.winfo_existscCs|j|jdd|j|S)zWReturn the number of pixels for the given distance NUMBER (e.g. "3c") as float.rZfpixelsr2rrrrenumberr r r winfo_fpixels=s  zMisc.winfo_fpixelscCs|jdd|jS)zFReturn geometry string for this widget in the form "widthxheight+X+Y".rgeometryrrr r r winfo_geometryCszMisc.winfo_geometrycCs|j|jdd|jS)zReturn height of this widget.rrXr!rr r r winfo_heightGszMisc.winfo_heightcCst|jdd|jdS)z%Return identifier ID for this widget.rrr)rar2rrrr r r winfo_idLsz Misc.winfo_idcCs"d||}|j|j|S)z9Return the name of all Tcl interpreters for this display.)rZinterps)rr2r.r)rerrr r r winfo_interpsPszMisc.winfo_interpscCs|j|jdd|jS)z%Return true if this widget is mapped.rZismappedr!rr r r winfo_ismappedUszMisc.winfo_ismappedcCs|jdd|jS)z/Return the window manager name for this widget.rZmanagerrrr r r winfo_managerZszMisc.winfo_managercCs|jdd|jS)zReturn the name of this widget.rrYrrr r r winfo_name^szMisc.winfo_namecCs|jdd|jS)z-Return the name of the parent of this widget.rparentrrr r r winfo_parentbszMisc.winfo_parentcCs d|||f}|j|S)z.Return the pathname of the widget given by ID.)rpathnamerrr r r winfo_pathnamefs zMisc.winfo_pathnamecCs|j|jdd|j|S)z'Rounded integer value of winfo_fpixels.rZpixelsr!r0r r r winfo_pixelslszMisc.winfo_pixelscCs|j|jdd|jS)z:Return the x coordinate of the pointer on the root window.rZpointerxr!rr r r winfo_pointerxqszMisc.winfo_pointerxcCs||jdd|jS)zHReturn a tuple of x and y coordinates of the pointer on the root window.rZ pointerxy_getintsr2rrrr r r winfo_pointerxyvszMisc.winfo_pointerxycCs|j|jdd|jS)z:Return the y coordinate of the pointer on the root window.rZpointeryr!rr r r winfo_pointery{szMisc.winfo_pointerycCs|j|jdd|jS)z'Return requested height of this widget.rZ reqheightr!rr r r winfo_reqheightszMisc.winfo_reqheightcCs|j|jdd|jS)z&Return requested width of this widget.rZreqwidthr!rr r r winfo_reqwidthszMisc.winfo_reqwidthcCs||jdd|j|S)zNReturn a tuple of integer RGB values in range(65536) for color in this widget.rZrgbrA)reZcolorr r r winfo_rgbszMisc.winfo_rgbcCs|j|jdd|jS)zSReturn x coordinate of upper left corner of this widget on the root window.rZrootxr!rr r r winfo_rootxszMisc.winfo_rootxcCs|j|jdd|jS)zSReturn y coordinate of upper left corner of this widget on the root window.rZrootyr!rr r r winfo_rootyszMisc.winfo_rootycCs|jdd|jS)z&Return the screen name of this widget.rscreenrrr r r winfo_screenszMisc.winfo_screencCs|j|jdd|jS)zTReturn the number of the cells in the colormap of the screen of this widget.rZ screencellsr!rr r r winfo_screencellsszMisc.winfo_screencellscCs|j|jdd|jS)z\Return the number of bits per pixel of the root window of the screen of this widget.rZ screendepthr!rr r r winfo_screendepthszMisc.winfo_screendepthcCs|j|jdd|jS)zXReturn the number of pixels of the height of the screen of this widget in pixel.rZ screenheightr!rr r r winfo_screenheightszMisc.winfo_screenheightcCs|j|jdd|jS)zUReturn the number of pixels of the height of the screen of this widget in mm.rZscreenmmheightr!rr r r winfo_screenmmheightszMisc.winfo_screenmmheightcCs|j|jdd|jS)zTReturn the number of pixels of the width of the screen of this widget in mm.rZ screenmmwidthr!rr r r winfo_screenmmwidthszMisc.winfo_screenmmwidthcCs|jdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen.rZ screenvisualrrr r r winfo_screenvisualszMisc.winfo_screenvisualcCs|j|jdd|jS)zWReturn the number of pixels of the width of the screen of this widget in pixel.rZ screenwidthr!rr r r winfo_screenwidthszMisc.winfo_screenwidthcCs|jdd|jS)zxReturn information of the X-Server of the screen of this widget in the form "XmajorRminor vendor vendorVersion".rZserverrrr r r winfo_serverszMisc.winfo_servercCs||jdd|jS)z*Return the toplevel widget of this widget.rtoplevel)rr2rrrr r r winfo_toplevels  zMisc.winfo_toplevelcCs|j|jdd|jS)zBReturn true if the widget and all its higher ancestors are mapped.rZviewabler!rr r r winfo_viewableszMisc.winfo_viewablecCs|jdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.rvisualrrr r r winfo_visualszMisc.winfo_visualcCs|jdd|jS)z7Return the X identifier for the visual for this widget.rZvisualidrrr r r winfo_visualidszMisc.winfo_visualidFcsHjddj|rdnd}fddj|D}fdd|DS)zReturn a list of all visuals available for the screen of this widget. Each item in the list consists of a visual name (see winfo_visual), a depth and if includeids is true is given also the X identifier.rZvisualsavailable includeidsNcsg|]}j|qSr )r2r.rrr r rsz/Misc.winfo_visualsavailable..csg|]}|qSr )_Misc__winfo_parseitemrrr r rs)r2rrr.)rerZrr rr winfo_visualsavailables  zMisc.winfo_visualsavailablecCs$|ddtt|j|ddS)rNr)rr_Misc__winfo_getint)rer4r r r Z__winfo_parseitemszMisc.__winfo_parseitemcCs t|dS)rr)rarerUr r r Z__winfo_getintszMisc.__winfo_getintcCs|j|jdd|jS)zReturn the height of the virtual root window associated with this widget in pixels. If there is no virtual root window return the height of the screen.rZ vrootheightr!rr r r winfo_vrootheightszMisc.winfo_vrootheightcCs|j|jdd|jS)zReturn the width of the virtual root window associated with this widget in pixel. If there is no virtual root window return the width of the screen.rZ vrootwidthr!rr r r winfo_vrootwidthszMisc.winfo_vrootwidthcCs|j|jdd|jS)ziReturn the x offset of the virtual root relative to the root window of the screen of this widget.rZvrootxr!rr r r winfo_vrootxszMisc.winfo_vrootxcCs|j|jdd|jS)ziReturn the y offset of the virtual root relative to the root window of the screen of this widget.rZvrootyr!rr r r winfo_vrooty szMisc.winfo_vrootycCs|j|jdd|jS)z Return the width of this widget.rrWr!rr r r winfo_widthszMisc.winfo_widthcCs|j|jdd|jS)zVReturn the x coordinate of the upper left corner of this widget in the parent.rrUr!rr r r winfo_xsz Misc.winfo_xcCs|j|jdd|jS)zVReturn the y coordinate of the upper left corner of this widget in the parent.rrVr!rr r r winfo_ysz Misc.winfo_ycCs|jddS)zEEnter event loop until all pending events have been processed by Tcl.r!Nrrr r r r! sz Misc.updatecCs|jdddS)zEnter event loop until all idle callbacks have been called. This will update the display of windows but not process events caused by the user.r!Z idletasksNrrr r r update_idletasks$szMisc.update_idletaskscCs6|dkr |j|jd|jS|jd|j|dS)a,Set or get the list of bindtags for this widget. With no argument return the list of all bindtags associated with this widget. With a list of strings as argument the bindtags are set to this list. The bindtags determine in which order events are processed (see bind).Nbindtagsr2r.rr)reZtagListr r r rg*s z Misc.bindtagsrcCst|tr |j|||fnn|rd|||j|}d|r>dp@d||jf}|j|||f|S|rz|j||fS|j|j|SdS)rz"%sif {"[%s %s]" == "break"} break +rZN)rrr2rr _substitute_subst_format_strr.)rerqsequencerr needcleanupfuncidrr r r _bind7s"   z Misc._bindcCs|d|jf|||S)aOBind to this widget at event SEQUENCE a call to function FUNC. SEQUENCE is a string of concatenated event patterns. An event pattern is of the form where MODIFIER is one of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4, Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3, B3, Alt, Button4, B4, Double, Button5, B5 Triple, Mod1, M1. TYPE is one of Activate, Enter, Map, ButtonPress, Button, Expose, Motion, ButtonRelease FocusIn, MouseWheel, Circulate, FocusOut, Property, Colormap, Gravity Reparent, Configure, KeyPress, Key, Unmap, Deactivate, KeyRelease Visibility, Destroy, Leave and DETAIL is the button number for ButtonPress, ButtonRelease and DETAIL is the Keysym for KeyPress and KeyRelease. Examples are for pressing Control and mouse button 1 or for pressing A and the Alt key (KeyPress can be omitted). An event pattern can also be a virtual event of the form <> where AString can be arbitrary. This event can be generated by event_generate. If events are concatenated they must appear shortly after each other. FUNC will be called if the event sequence occurs with an instance of Event as argument. If the return value of FUNC is "break" no further bound function is invoked. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. Bind will return an identifier to allow deletion of the bound function with unbind without memory leak. If FUNC or SEQUENCE is omitted the bound function or list of bound events are returned.bindrorrerlrrr r r rpIs'z Misc.bindcCs&|jd|j|d|r"||dS)zWUnbind for this widget for event SEQUENCE the function identified with FUNCID.rprZNr2rrr)rerlrnr r r unbindrsz Misc.unbindcCs|d|||dS)aBind to all widgets at an event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.)rpallrrorrr r r bind_allysz Misc.bind_allcCs|jdd|ddS)z8Unbind for all widgets for event SEQUENCE all functions.rprurZNr)rerlr r r unbind_allszMisc.unbind_allcCs|d|f|||dS)a=Bind to widgets with bindtag CLASSNAME at event SEQUENCE a call of function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.rprrv)rer rlrrr r r bind_classszMisc.bind_classcCs|jd||ddS)zWUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.rprZNr)rer rlr r r unbind_classszMisc.unbind_classcCs|j|dS)zCall the mainloop of Tk.N)r2r)rerhr r r rsz Misc.mainloopcCs|jdS)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r2quitrr r r r{sz Misc.quitcCs"|rtt|jj|j|SdSrt)rrr2rr.rerr r r rBsz Misc._getintscCs"|rtt|jj|j|SdSrt)rrr2rr.r|r r r _getdoublesszMisc._getdoublescCs|r|j|SdSrt)r2rr|r r r _getbooleanszMisc._getbooleancCs"|r d|fS|dkrd|jfSdS)rrNr rrr r r rs  zMisc._displayofcCsBz |jWStk r<|jdd}|_|YSXdS)rr2ZwindowingsystemN)rZ_windowingsystem_cachedr"r2r)reZwsr r r rs   zMisc._windowingsystemcCs|rt||f}nt|}d}|D]\}}|dk r&|ddkrN|dd}t|rb||}n^t|ttfrg}|D]<}t|tr|t |qxt|t r|t |qxqqxd |}|d||f}q&|S)rr N_rr-) r+r%callablerrrrrarcrrr)rer&rrr)r*Znvrr r r rs*     z Misc._optionscCsNt|d}|}|ds.|}|dd}|D]}|s>qJ|j|}q2|S)zPReturn the Tkinter instance of a widget identified by its Tcl name NAME..rrN)rsplitrr#)rerYwrhr r r nametowidgets  zMisc.nametowidgetcCst|||j}tt|}z |j}Wntk r8YnXz||j}Wntk r\YnX|j|||r|j dkrg|_ |j ||S)zReturn a newly created Tcl function. If this function is called, the Python function FUNC will be executed. An optional function SUBST can be given which will be executed before FUNC.N) rrr_rrr"rAr2rrrc)rersubstrmrrYr r r rs     zMisc._registercCs|}|jr|j}q|S)rr)rerr r r rsz Misc._root)z%#z%bz%fz%hz%kz%sz%tz%wz%xz%yz%Az%Ez%Kz%Nz%Wz%Tz%Xz%Yz%Drcst|t|jkr|S|jj}|jjfdd}|\}}}}}} } } } } }}}}}}}}}t}||_|||_z|||_Wnt k rYnX|||_ |||_ || |_ || |_ || |_|| |_|| |_||_z|||_Wnt k r YnX||_|||_zt||_Wntk rF||_YnXz|||_Wntk rt||_YnX|||_|||_z||_Wn tt fk rd|_YnX|fS)rc s,z |WSttfk r&|YSXdS)z?Tk changed behavior in 8.4.2, returning "??" rather more often.N)rwrrrr r getint_events z&Misc._substitute..getint_eventr)r _subst_formatr2rrrGserialrSrTrrXrRrNtimerWrUrVrLrMrQZ keysym_numr8r rwrwidgetr$Zx_rootZy_rootrP)rerrrZnsignbrhr)rfr4rrUrVAEKNWTXYDer rr rj sT *               zMisc._substitutecCs(t\}}}|}||||dSrt)sysexc_inforreport_callback_exception)rervaltbrrr r r _report_exceptionHszMisc._report_exceptioncGs\i}|j|jj|D]>}|j|}|dddf|dd||ddd<q|S)z;Call Tcl configure command and return the result as a dict.rrNr2r.r)rerr&rUr r r _getconfigureNs  0zMisc._getconfigurecGs2|j|jj|}|dddf|ddS)Nrrr)rerrUr r r _getconfigure1VszMisc._getconfigure1cCs|rt||f}n |rt|}|dkr:|t|j|fSt|tr^|t|j|d|fS|jt|j|f| |dS)rNr-) r+rrrrrrr2rr)rerr&rr r r _configureZs zMisc._configurecKs|d||S)zConfigure resources of a widget. The values for resources are specified as keyword arguments. To get an overview about the allowed keyword arguments call the method keys. configurerrer&rr r r rgszMisc.configurecCs|j|jdd|S)z4Return the resource value for a KEY given as string.cgetr-rrer6r r r rrsz Misc.cgetcCs|||idSr)rrer6r r r r __setitem__xszMisc.__setitem__cs*|jjfdd|j|jdDS)z3Return a list of all resource names of this widget.cs g|]}|dddqS)rrNr rrr r r~szMisc.keys..rrhrr rr ri{s z Misc.keyscCs|jS)z+Return the window path name of this widget.rrr r r rFsz Misc.__str__cCsd|jj|jj|jfS)Nz<%s.%s object %s>)rrBrCrrr r r rjs z Misc.__repr___noarg_cCs:|tjkr"||jdd|jS|jdd|j|dS)aSet or get the status for propagation of geometry information. A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given the current setting will be returned. pack propagateNrrr~r2rrreflagr r r pack_propagates  zMisc.pack_propagatecs(fddjjddjDS)HReturn a list of all slaves of this widget in its packing order.csg|]}|qSr rrrr r rsz$Misc.pack_slaves..rslavesrhrr rr pack_slavess  zMisc.pack_slavescs(fddjjddjDS)rcsg|]}|qSr rrrr r rsz%Misc.place_slaves..placerrhrr rr place_slavess zMisc.place_slavescCs|jdd|j|dS)zThe anchor value controls how to place the grid within the master when no row/column has any weight. The default anchor is nw.gridanchorNr)rerr r r grid_anchorszMisc.grid_anchorcCsZdd|jf}|dk r(|dk r(|||f}|dk rD|dk rD|||f}||jj|pXdS)aReturn a tuple of integer coordinates for the bounding box of this widget controlled by the geometry manager grid. If COLUMN, ROW is given the bounding box applies from the cell with row and column 0 to the specified cell. If COL2 and ROW2 are given the bounding box starts at that cell. The returned integers specify the offset of the upper left corner in the master widget and the width and height. rbboxN)rrBr2r)recolumnrowZcol2Zrow2rr r r grid_bboxs   zMisc.grid_bboxc Csht|ttjfrdz:t|}|s$WdSd|kr:|j|WS|j|WSWnttfk rbYnX|S)Nr) rr_tkinterZTcl_Objr2rrrwr)rer Zsvaluer r r _gridconvvalueszMisc._gridconvvaluecCst|trJ|sJ|dddkr*|dd}|dddkrBd|}|f}n |||}|s|t|j|jd||j||jdS|jd||j|f|}t|dkr||SdS)rrNrrr-r)r3) rrrr7r2rrrr)rerindexr&roptionsrr r r _grid_configures(    zMisc._grid_configurecKs|d|||S)zConfigure column INDEX of a grid. Valid resources are minsize (minimum size of the column), weight (how much does additional space propagate to this column) and pad (how much space to let additionally).columnconfigurerrerr&rr r r grid_columnconfigureszMisc.grid_columnconfigurec Cs ||jdd|j||pdS)zReturn a tuple of column and row which identify the cell at which the pixel at position X and Y inside the master widget is located.rlocationNrArerUrVr r r grid_locationszMisc.grid_locationcCs:|tjkr"||jdd|jS|jdd|j|dS)aSet or get the status for propagation of geometry information. A boolean argument specifies whether the geometry information of the slaves will determine the size of this widget. If no argument is given, the current setting will be returned. rrNrrr r r grid_propagates  zMisc.grid_propagatecKs|d|||S)zConfigure row INDEX of a grid. Valid resources are minsize (minimum size of the row), weight (how much does additional space propagate to this row) and pad (how much space to let additionally). rowconfigurerrr r r grid_rowconfigureszMisc.grid_rowconfigurecCs||jdd|jpdS)z.rrrh)rerrrr rr grid_slaves s    zMisc.grid_slavescGsdd|f|}|j|dS)zBind a virtual event VIRTUAL (of the form <>) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs.eventrNrrevirtual sequencesrr r r event_add/szMisc.event_addcGsdd|f|}|j|dS)z-Unbind a virtual event VIRTUAL from SEQUENCE.rdeleteNrrr r r event_delete6szMisc.event_deletecKsDdd|j|f}|D]\}}|d|t|f}q|j|dS)zGenerate an event SEQUENCE. Additional keyword arguments specify parameter of the event (e.g. x, y, rootx, rooty).rZgenerate-%sN)rr%rr2r)rerlrrr)r*r r r event_generate;szMisc.event_generatecCs|j|jdd|S)zuReturn a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL.rr}r)rerr r r event_infoDszMisc.event_infocCs|j|jddS)z*Return a list of all existing image names.imagenamesrrr r r image_namesLszMisc.image_namescCs|j|jddS)z?Return a list of all available image types (e.g. photo bitmap).rtypesrrr r r image_typesPszMisc.image_types)N)r|)N)N)r|r)r|)N)r)N)N)N)N)r)r)r)r)r)F)N)r)NNN)N)NNN)NNN)r)N)Nr)N)N)NNNN)NN)N)rArBrCrk_last_child_idsrrrrrrrZwaitvarrrrrrrrrrTrrrrrrrrrrrrrrrrrrrrr r r rrrrrrrrliftrr r"r'r)r+r,r-r.r2r4r5r6r7r8r9r:r<r>r?r@rCrDrErFrGrHrIrKrLrMrNrOrPrQrRrSrUrVrXrYr\r[r]r_r`rarbrcrdrer!rfrgrorprtrwrxryrzrr{rBr}r~rpropertyrrrrrregisterrrrrkrjrrrrrconfigr __getitem__rrirFrjrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r rmsP                          )       =                  rc@s eZdZdZddZddZdS)rzwInternal class. Stores function to call when some user defined Tcl function is called e.g. after an event occurred.cCs||_||_||_dS)z(Store FUNC, SUBST and WIDGET as members.N)rrr)rerrrr r r rYszCallWrapper.__init__cGsLz|jr|j|}|j|WStk r2Yn|jYnXdS)z3Apply first function SUBST to arguments, than FUNC.N)rrrxrrrerr r r r_s  zCallWrapper.__call__NrArBrCrkrrr r r r rUsrc@s(eZdZdZddZddZddZdS) XViewzXMix-in class for querying and changing the horizontal position of a widget's window.cGs(|jj|jdf|}|s$||SdS)z5Query and change the horizontal position of the view.xviewNr2rrr}rerrr r r rosz XView.xviewcCs|j|jdd|dS)zsAdjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.rmovetoNrrefractionr r r xview_movetouszXView.xview_movetocCs|j|jdd||dS)z\Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).rscrollNrrer1rqr r r xview_scrollzszXView.xview_scrollN)rArBrCrkrrrr r r r rksrc@s(eZdZdZddZddZddZdS) YViewzVMix-in class for querying and changing the vertical position of a widget's window.cGs(|jj|jdf|}|s$||SdS)z3Query and change the vertical position of the view.yviewNrrr r r rsz YView.yviewcCs|j|jdd|dS)zsAdjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.rrNrrr r r yview_movetoszYView.yview_movetocCs|j|jdd||dS)z\Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT).rrNrrr r r yview_scrollszYView.yview_scrollN)rArBrCrkrrrr r r r rsrc@seZdZdZdBddZeZddZeZdCddZeZ d d Z e Z dDd d Z e Z d dZeZdEddZeZddZeZddZeZdFddZeZdGddZeZdHddZeZdIddZeZddZeZdJdd Z e Z!dKd!d"Z"e"Z#dLd$d%Z$e$Z%dMd&d'Z&e&Z'dNd(d)Z(e(Z)d*d+Z*e*Z+dOd,d-Z,e,Z-dPd.d/Z.e.Z/dQd0d1Z0e0Z1dRd2d3Z2e2Z3dSd4d5Z4e4Z5dTd6d7Z6e6Z7dUd8d9Z8e8Z9dVd:d;Z:e:Z;dWdd?Z>e>Z?d@dAZ@e@ZAdS)YWmzAProvides functions for the communication with the window manager.Nc Cs ||jdd|j||||S)zInstruct the window manager to set the aspect ratio (width/height) of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple of the actual values if no argument is given.wmaspectrA)reZminNumerZminDenomZmaxNumerZmaxDenomr r r wm_aspectsz Wm.wm_aspectcGsdd|jf|}|j|S)aThis subcommand returns or sets platform specific attributes The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows: On Windows, -disabled gets or sets whether the window is in a disabled state. -toolwindow gets or sets the style of the window to toolwindow (as defined in the MSDN). -topmost gets or sets whether this is a topmost window (displays above all other windows). On Macintosh, XXXXX On Unix, there are currently no special attribute values. r attributes)rr2rrr r r wm_attributesszWm.wm_attributescCs|jdd|j|S)zVStore NAME in WM_CLIENT_MACHINE property of this widget. Return current value.rclientrrr r r wm_clientsz Wm.wm_clientcsZt|dkr|f}ddjf|}|r4j|n"fddjj|DSdS)zStore list of window names (WLIST) into WM_COLORMAPWINDOWS property of this widget. This list contains windows whose colormaps differ from their parents. Return current list of widgets if WLIST is empty.rrcolormapwindowscsg|]}|qSr rrrr r rsz)Wm.wm_colormapwindows..N)rrr2rr.)reZwlistrr rr wm_colormapwindowss  zWm.wm_colormapwindowscCs|jdd|j|S)zStore VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.rrrrr r r wm_commandsz Wm.wm_commandcCs|jdd|jS)zDeiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.r deiconifyrrr r r wm_deiconifyszWm.wm_deiconifycCs|jdd|j|S)zSet focus model to MODEL. "active" means that this widget will claim the focus itself, "passive" means that the window manager shall give the focus. Return current focus model if MODEL is None.r focusmodelr)reZmodelr r r wm_focusmodelszWm.wm_focusmodelcCs|jdd|dS)aAThe window will be unmapped from the screen and will no longer be managed by wm. toplevel windows will be treated like frame windows once they are no longer managed by wm, however, the menu option configuration will be remembered and the menus will return once the widget is managed again.rforgetNrrr r r wm_forgetsz Wm.wm_forgetcCs|jdd|jS)zAReturn identifier for decorative frame of this widget if present.rframerrr r r wm_framesz Wm.wm_framecCs|jdd|j|S)ziSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.rr3r)reZ newGeometryr r r wm_geometryszWm.wm_geometryc Cs ||jdd|j||||S)aInstruct the window manager that this widget shall only be resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the number of grid units requested in Tk_GeometryRequest.rrrA)reZ baseWidthZ baseHeightZwidthIncZ heightIncr r r wm_grids z Wm.wm_gridcCs|jdd|j|S)z~Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.rgrouprreZpathNamer r r wm_group sz Wm.wm_groupcCs2|r|jdd|jd|S|jdd|j|SdS)aSet bitmap for the iconified widget to BITMAP. Return the bitmap if None is given. Under Windows, the DEFAULT parameter can be used to set the icon for the widget and any descendents that don't have an icon set explicitly. DEFAULT can be the relative path to a .ico file (example: root.iconbitmap(default='myicon.ico') ). See Tk documentation for more information.r iconbitmap-defaultNr)rebitmapdefaultr r r wm_iconbitmaps zWm.wm_iconbitmapcCs|jdd|jS)zDisplay widget as icon.riconifyrrr r r wm_iconify$sz Wm.wm_iconifycCs|jdd|j|S)zVSet mask for the icon bitmap of this widget. Return the mask if None is given.riconmaskr)rerr r r wm_iconmask*szWm.wm_iconmaskcCs|jdd|j|S)zSSet the name of the icon for this widget. Return the name if None is given.riconnamer)reZnewNamer r r wm_iconname1szWm.wm_iconnameFcGs<|r |jjdd|jdf|n|jjdd|jf|dS)aSets the titlebar icon for this window based on the named photo images passed through args. If default is True, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the time of invocation. If the images are later changed, this is not reflected to the titlebar icons. Multiple images are accepted to allow different images sizes to be provided. The window manager may scale provided icons to an appropriate size. On Windows, the images are packed into a Windows icon structure. This will override an icon specified to wm_iconbitmap, and vice versa. On X, the images are arranged into the _NET_WM_ICON X property, which most modern window managers support. An icon specified by wm_iconbitmap may exist simultaneously. On Macintosh, this currently does nothing.r iconphotorNr)rerrr r r wm_iconphoto8szWm.wm_iconphotoc Cs||jdd|j||S)zSet the position of the icon of this widget to X and Y. Return a tuple of the current values of X and X if None is given.r iconpositionrArr r r wm_iconpositionSs zWm.wm_iconpositioncCs|jdd|j|S)zgSet widget PATHNAME to be displayed instead of icon. Return the current value if None is given.r iconwindowrrr r r wm_iconwindow[szWm.wm_iconwindowcCs|jdd|dS)zThe widget specified will become a stand alone top-level window. The window will be decorated with the window managers title bar, etc.rmanageNr)rerr r r wm_managebsz Wm.wm_managec Cs||jdd|j||S)zSet max WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.rmaxsizerArerWrXr r r wm_maxsizejs z Wm.wm_maxsizec Cs||jdd|j||S)zSet min WIDTH and HEIGHT for this widget. If the window is gridded the values are given in grid units. Return the current values if None is given.rminsizerAr$r r r wm_minsizess z Wm.wm_minsizecCs||jdd|j|S)zInstruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.roverrideredirect)r~r2rrrr r r wm_overrideredirect|s  zWm.wm_overrideredirectcCs|jdd|j|S)zInstruct the window manager that the position of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".r positionfromrreZwhor r r wm_positionfromszWm.wm_positionfromcCs.t|r||}n|}|jdd|j||S)zBind function FUNC to command NAME for this widget. Return the function bound to NAME if None is given. NAME could be e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".rprotocol)rrr2rr)rerYrrr r r wm_protocols zWm.wm_protocolcCs|jdd|j||S)zyInstruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.r resizablerr$r r r wm_resizableszWm.wm_resizablecCs|jdd|j|S)zInstruct the window manager that the size of this widget shall be defined by the user if WHO is "user", and by its own policy if WHO is "program".rsizefromrr+r r r wm_sizefromszWm.wm_sizefromcCs|jdd|j|S)zQuery or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).rrNr)reZnewstater r r wm_statesz Wm.wm_statecCs|jdd|j|S)zSet the title of this widget.rtitlerr|r r r wm_titlesz Wm.wm_titlecCs|jdd|j|S)z_Instruct the window manager that this widget is transient with regard to widget MASTER.r transientr)rerr r r wm_transientszWm.wm_transientcCs|jdd|jS)zWithdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.rwithdrawrrr r r wm_withdrawszWm.wm_withdraw)NNNN)N)N)N)N)NNNN)N)NN)N)N)F)NN)N)NN)NN)N)N)NN)NN)N)N)N)N)BrArBrCrkrrrrrrrrrrrrrrrrr r r r3r rrr rrrrrrrrrrrrr rr"r!r%r#r'r&r)r(r,r*r.r-r0r/r2r1r3rNr5r4r7r6r9r8r r r r rs                        rc@sNeZdZdZdZdddZdd Zd d Zd d ZddZ ddZ ddZ dS)rozzToplevel widget of Tk which represents mostly the main window of an application. It has an associated Tcl interpreter.rNrrc Csd|_i|_d|_d|_|dkrZddl}|jtjd}|j |\}}|dkrZ||}d} t |||| t ||||_|r| tjjs|||dS)a@Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME is the name of the widget class.NFr)z.pyz.pyc)rr# _tkloadedr2ospathbasenamerargvsplitextrcreate wantobjects_loadtkflagsignore_environment readprofile) re screenNamebaseNamer useTksyncZuser;Zext interactiver r r rs z Tk.__init__cCs|js|j|dSr)r:r2loadtkrBrr r r rKs z Tk.loadtkcCsd|_|jd}|tjkr.tdtj|ft|jd}|tjkrZtdtj|f|jdkrjg|_|j dt |j dt |j d|j dt rts|a|d|jdS) NT tk_versionz4tk.h version (%s) doesn't match libtk.a version (%s) tcl_versionz6tcl.h version (%s) doesn't match libtcl.a version (%s)ZtkerrorexitWM_DELETE_WINDOW)r:r2rr TK_VERSIONr/r TCL_VERSIONrrrvrzrcrlrmr-r)rerLrMr r r rBs(      z Tk._loadtkcCsJt|jD] }|q|jd|jt|trFt |krFda dS)zhDestroy this and all descendants widgets. This will end the application of this Tcl interpreter.rN) rr#valuesrr2rrrrlrmrer'r r r r s    z Tk.destroyc Csddl}d|jkr|jd}n|j}|j|d|}|j|d|}|j|d|}|j|d|}d|i} td| |j|r|jd||j|rtt | | |j|r|jd||j|rtt | | dS) zInternal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls exec on the contents of BASENAME.py and CLASSNAME.py if such a file exists in the home directory.rNHOMEz.%s.tclz.%s.pyrezfrom tkinter import *source) r;environcurdirr<rexecisfiler2ropenread) rerGr r;homeZ class_tclZclass_pyZbase_tclZbase_pydirr r r rE s$      zTk.readprofilecCs:ddl}tdtjd|t_|t_|t_||||dS)zReport callback exception on sys.stderr. Applications may want to override this internal function, and should when sys.stderr is None.rNzException in Tkinter callback)file) tracebackr$rstderr last_type last_valuelast_tracebackprint_exception)rerrrr_r r r r$ s zTk.report_callback_exceptioncCs t|j|S)z3Delegate attribute access to the interpreter object)r`r2)reattrr r r __getattr__0 szTk.__getattr__)NNrorrN) rArBrCrkrrrKrBrrErrfr r r r ros   rocCst||||Sr)ro)rFrGr rHr r r TclC srgc@sTeZdZdZifddZeZZZddZeZ ddZ e Z e j ZZ e jZZdS) PackzQGeometry manager Pack. Base class to use the methods pack_* in every widget.cKs$|jdd|jf|||dS)a(Pack a widget in the parent widget. Use as options: after=widget - pack it after you have packed widget anchor=NSEW (or subset) - position widget according to given direction before=widget - pack it before you will pack widget expand=bool - expand widget if parent size grows fill=NONE or X or Y or BOTH - fill widget if widget grows in=master - use master to contain this widget in_=master - see 'in' option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget. rrNr2rrrrr r r pack_configureL s   zPack.pack_configurecCs|jdd|jdS)z:Unmap this widget and do not use it for the packing order.rrNrrr r r pack_forgetb szPack.pack_forgetcCs8t|j|jdd|j}d|kr4||d|d<|S)zEReturn information about the packing options for this widget.rr}inr7r2rrrredr r r pack_infoh szPack.pack_infoN)rArBrCrkrjrrrrkrrpr}rrrrrr r r r rhG s   rhc@sJeZdZdZifddZeZZZddZeZ ddZ e Z e j ZZ dS) PlacezSGeometry manager Place. Base class to use the methods place_* in every widget.cKs$|jdd|jf|||dS)a Place a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed in_=master - see 'in' option description x=amount - locate anchor of this widget at position x of master y=amount - locate anchor of this widget at position y of master relx=amount - locate anchor of this widget between 0.0 and 1.0 relative to width of master (1.0 is right edge) rely=amount - locate anchor of this widget between 0.0 and 1.0 relative to height of master (1.0 is bottom edge) anchor=NSEW (or subset) - position anchor according to given direction width=amount - width of this widget in pixel height=amount - height of this widget in pixel relwidth=amount - width of this widget between 0.0 and 1.0 relative to width of master (1.0 is the same width as the master) relheight=amount - height of this widget between 0.0 and 1.0 relative to height of master (1.0 is the same height as the master) bordermode="inside" or "outside" - whether to take border width of master widget into account rrNrirr r r place_configurez s   zPlace.place_configurecCs|jdd|jdS)Unmap this widget.rrNrrr r r place_forget szPlace.place_forgetcCs8t|j|jdd|j}d|kr4||d|d<|S)zEReturn information about the placing options for this widget.rr}rlrmrnr r r place_info szPlace.place_infoN)rArBrCrkrrrrrrtrrur}rrrr r r r rqu s  rqc@seZdZdZifddZeZZZej Z Z ej Z Z ddZ e ZddZdd ZeZejZZejZZejZZejZZejZZd S) GridzQGeometry manager Grid. Base class to use the methods grid_* in every widget.cKs$|jdd|jf|||dS)aPosition a widget in the parent widget in a grid. Use as options: column=number - use cell identified with given column (starting with 0) columnspan=number - this widget will span several columns in=master - use master to contain this widget in_=master - see 'in' option description ipadx=amount - add internal padding in x direction ipady=amount - add internal padding in y direction padx=amount - add padding in x direction pady=amount - add padding in y direction row=number - use cell identified with given row (starting with 0) rowspan=number - this widget will span several rows sticky=NSEW - if cell is larger on which sides will this widget stick to the cell boundary rrNrirr r r grid_configure s   zGrid.grid_configurecCs|jdd|jdS)rsrrNrrr r r grid_forget szGrid.grid_forgetcCs|jdd|jdS)z0Unmap this widget but remember the grid options.rrNrrr r r grid_remove szGrid.grid_removecCs8t|j|jdd|j}d|kr4||d|d<|S)zSReturn information about the options for positioning this widget in a grid.rr}rlrmrnr r r grid_info szGrid.grid_infoN)rArBrCrkrwrrrrrrrrrxrryrzr}rrrrrrrrrrr r r r rv s        rvc@s:eZdZdZddZiidfddZddZd d d Zd S) BaseWidgetzInternal class.cCs|s t}||_|j|_d}d|kr2|d}|d=|s|jj}|jdkrRi|_|j|dd}||j|<|dkrd|f}n d||f}||_|j dkrd||_ n|j d||_ i|_ |j|jj kr|jj |j ||jj |j<dS)z6Internal function. Sets up information about children.NrYrrz!%sz!%s%dr) rsrr2rrArrrrrr#r)rerr&rYcountr r r _setup s2       zBaseWidget._setupr c Cs|rt||f}||_t||||jdkr4g|_dd|D}|D]\}}||=qJ|j||jf|| ||D]\}}| ||q~dS)zdConstruct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.NcSs"g|]\}}t|tr||fqSr )rr rIr r r r s z'BaseWidget.__init__..) r+ widgetNamer{r}rr%r2rrrr) rerr~r&rextraclassesr)r*r r r r s    zBaseWidget.__init__cCsTt|jD] }|q|jd|j|j|jjkrF|jj|j=t |dS)z)Destroy this and all descendants widgets.rN) rr#rRrr2rrrrrrSr r r r s   zBaseWidget.destroycCs|j|j|f|Srr)rerYrr r r _do szBaseWidget._doN)r )rArBrCrkr}rrrr r r r r{ s r{c@seZdZdZdS)WidgetzxInternal class. Base class for a widget which can be positioned with the geometry managers Pack, Place or Grid.N)rArBrCrkr r r r r src@seZdZdZdifddZdS)Toplevelz"Toplevel widget, e.g. for dialogs.Nc Ks|rt||f}d}dD]L}||kr||}|ddkrJd|dd}nd|}|||f}||=qt||d|i||}|||||d|jdS) a%Construct a toplevel widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, highlightcolor, highlightthickness, menu, relief, screen, takefocus, use, visual, width.r )rJclass_r(rWZcolormaprrr-NrTrO)r+r{rrrr4r-r) rerr&rrZwmkeyroptrrr r r r) s    zToplevel.__init__rArBrCrkrr r r r r& src@s.eZdZdZdifddZddZddZdS) rDzButton widget.NcKst||d||dS)aUConstruct a button widget with the parent MASTER. STANDARD OPTIONS activebackground, activeforeground, anchor, background, bitmap, borderwidth, cursor, disabledforeground, font, foreground highlightbackground, highlightcolor, highlightthickness, image, justify, padx, pady, relief, repeatdelay, repeatinterval, takefocus, text, textvariable, underline, wraplength WIDGET-SPECIFIC OPTIONS command, compound, default, height, overrelief, state, width ZbuttonNrrrerr&rr r r rG szButton.__init__cCs|j|jddS)a_Flash the button. This is accomplished by redisplaying the button several times, alternating between active and normal colors. At the end of the flash the button is left in the same normal/active state as when the command was invoked. This command is ignored if the button's state is disabled. flashNrrr r r r\ s z Button.flashcCs|j|jdS)aInvoke the command associated with the button. The return value is the return value from the command, or an empty string if there is no command associated with the button. This command is ignored if the button's state is disabled. invokerrr r r rh sz Button.invoke)rArBrCrkrrrr r r r rDD s rDc@seZdZdZdifddZddZddZd d Zd d Zdwd dZ ddZ ddZ ddZ ddZ dxddZdyddZdzddZd{ddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#d|dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-d}dWdXZ.e.Z/dYdZZ0e0Z1d[d\Z2d~d^d_Z3ifd`daZ4dbdcZ5e5Z6Z7dddeZ8dfdgZ9ddidjZ:dkdlZ;dmdnZdsdtZ?dudvZ@dS)Canvasz?Canvas widget to display graphical elements like lines or text.NcKst||d||dS)aConstruct a canvas widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, closeenough, confine, cursor, height, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, offset, relief, scrollregion, selectbackground, selectborderwidth, selectforeground, state, takefocus, width, xscrollcommand, xscrollincrement, yscrollcommand, yscrollincrement.ZcanvasNrrr r r rv s zCanvas.__init__cGs|j|jdf|dS)raddtagNrrr r r r sz Canvas.addtagcCs||d|dS)z*Add tag NEWTAG to all items above TAGORID.aboveNrrenewtagtagOrIdr r r addtag_above szCanvas.addtag_abovecCs||ddS)zAdd tag NEWTAG to all items.ruNr)rerr r r addtag_all szCanvas.addtag_allcCs||d|dS)z*Add tag NEWTAG to all items below TAGORID.belowNrrr r r addtag_below szCanvas.addtag_belowcCs||d||||dS)zAdd tag NEWTAG to item which is closest to pixel at X, Y. If several match take the top-most. All items closer than HALO are considered overlapping (all are closests). If START is specified the next below this tag is taken.closestNr)rerrUrVhalostartr r r addtag_closest szCanvas.addtag_closestcCs||d||||dS)zLAdd tag NEWTAG to all items in the rectangle defined by X1,Y1,X2,Y2.enclosedNrrerx1y1x2y2r r r addtag_enclosed szCanvas.addtag_enclosedcCs||d||||dS)zWAdd tag NEWTAG to all items which overlap the rectangle defined by X1,Y1,X2,Y2. overlappingNrrr r r addtag_overlapping szCanvas.addtag_overlappingcCs||d|dS)z)Add tag NEWTAG to all items with TAGORID.withtagNrrr r r addtag_withtag szCanvas.addtag_withtagcGs ||j|jdf|pdS)z|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses all items with tags specified as arguments.rNrArr r r r s z Canvas.bboxcCs(|j|jd||d|r$||dS)zbUnbind for all items with TAGORID for event SEQUENCE the function identified with FUNCID.rprZNrs)rerrlrnr r r tag_unbind szCanvas.tag_unbindcCs||jd|f|||S)a&Bind to all items with TAGORID at event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.rprq)rerrlrrr r r tag_bind s zCanvas.tag_bindcCs|j|j|jd||S)zrReturn the canvas x coordinate of pixel position SCREENX rounded to nearest multiple of GRIDSPACING units.canvasxr/)reZscreenx gridspacingr r r r s  zCanvas.canvasxcCs|j|j|jd||S)zrReturn the canvas y coordinate of pixel position SCREENY rounded to nearest multiple of GRIDSPACING units.canvasyr/)reZscreenyrr r r r s  zCanvas.canvasycs,fddjjjdf|DS)z8Return a list of coordinates for the item given in ARGS.csg|]}j|qSr )r2rrrr r r sz!Canvas.coords..coordsrhrr rr r s  z Canvas.coordsc Cs\t|}|d}t|ttfr,|dd}ni}|j|jj|jd|f||||S)rrNr@) rrrrr2rrrr)reitemTyperrr&r r r _create s zCanvas._createcOs|d||S)z6Create arc shaped region with coordinates x1,y1,x2,y2.Zarcrrr r r create_arc szCanvas.create_arccOs|d||S)z%Create bitmap with coordinates x1,y1.rrrr r r create_bitmap szCanvas.create_bitmapcOs|d||S)z)Create image item with coordinates x1,y1.rrrr r r create_image szCanvas.create_imagecOs|d||S)z-Create line with coordinates x1,y1,...,xn,yn.linerrr r r create_line szCanvas.create_linecOs|d||S)z)Create oval with coordinates x1,y1,x2,y2.Zovalrrr r r create_oval szCanvas.create_ovalcOs|d||S)z0Create polygon with coordinates x1,y1,...,xn,yn.Zpolygonrrr r r create_polygon szCanvas.create_polygoncOs|d||S)z.Create rectangle with coordinates x1,y1,x2,y2.Z rectanglerrr r r create_rectangle szCanvas.create_rectanglecOs|d||S)z#Create text with coordinates x1,y1.textrrr r r create_text szCanvas.create_textcOs|d||S)z+Create window with coordinates x1,y1,x2,y2.rrrr r r create_window szCanvas.create_windowcGs|j|jdf|dS)zDelete characters of text items identified by tag or id in ARGS (possibly several times) from FIRST to LAST character (including).dcharsNrrr r r r sz Canvas.dcharscGs|j|jdf|dS)zeZdZdZdifddZddZddZd d Zd d ZdS) RadiobuttonzGRadiobutton widget which shows only one of several buttons in on-state.NcKst||d||dS)aConstruct a radiobutton widget with the parent MASTER. Valid resource names: activebackground, activeforeground, anchor, background, bd, bg, bitmap, borderwidth, command, cursor, disabledforeground, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, image, indicatoron, justify, padx, pady, relief, selectcolor, selectimage, state, takefocus, text, textvariable, underline, value, variable, width, wraplength.rNrrr r r rV s zRadiobutton.__init__cCs|j|jddSrrrr r r rb szRadiobutton.deselectcCs|j|jddSrrrr r r rg szRadiobutton.flashcCs|j|jdSrrrr r r rk szRadiobutton.invokecCs|j|jddSrrrr r r ro szRadiobutton.select) rArBrCrkrrrrrr r r r r+S s  r+c@s@eZdZdZdifddZddZddZd d d Zd d ZdS)Scalez1Scale widget which can display a numerical scale.NcKst||d||dS)aConstruct a scale widget with the parent MASTER. Valid resource names: activebackground, background, bigincrement, bd, bg, borderwidth, command, cursor, digits, fg, font, foreground, from, highlightbackground, highlightcolor, highlightthickness, label, length, orient, relief, repeatdelay, repeatinterval, resolution, showvalue, sliderlength, sliderrelief, state, takefocus, tickinterval, to, troughcolor, variable, width.rNrrr r r rw s zScale.__init__c CsJ|j|jd}z|j|WStttfk rD|j|YSXdS)z*Get the current value as integer or float.rN)r2rrrrwr#rrrr r r r s z Scale.getcCs|j|jd|dS)zSet the value to VALUE.rNrrr r r r sz Scale.setcCs||j|jd|S)zReturn a tuple (X,Y) of the point along the centerline of the trough that corresponds to VALUE or the current value if None is given.rrArr r r r sz Scale.coordscCs|j|jd||S)zcReturn where the point X,Y lies. Valid return values are "slider", "though1" and "though2".identifyrrr r r r- szScale.identify)N) rArBrCrkrrrrr-r r r r r,t s   r,c@sPeZdZdZdifddZdddZddZd d Zd d Zd dZ ddZ dS) Scrollbarz?Scrollbar widget which displays a slider at a certain position.NcKst||d||dS)alConstruct a scrollbar widget with the parent MASTER. Valid resource names: activebackground, activerelief, background, bd, bg, borderwidth, command, cursor, elementborderwidth, highlightbackground, highlightcolor, highlightthickness, jump, orient, relief, repeatdelay, repeatinterval, takefocus, troughcolor, width.Z scrollbarNrrr r r r s zScrollbar.__init__cCs|j|jd|pdS)aMarks the element indicated by index as active. The only index values understood by this method are "arrow1", "slider", or "arrow2". If any other value is specified then no element of the scrollbar will be active. If index is not specified, the method returns the name of the element that is currently active, or None if no element is active.rNrrr r r r szScrollbar.activatecCs|j|j|jd||S)znReturn the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.rPr/)reZdeltaxZdeltayr r r rP szScrollbar.deltacCs|j|j|jd||S)zRReturn the fractional value which corresponds to a slider position of X,Y.rr/rr r r r szScrollbar.fractioncCs|j|jd||S)zYReturn the element under position X,Y as one of "arrow1","slider","arrow2" or "".r-rrr r r r- szScrollbar.identifycCs||j|jdS)zZReturn the current fractional values (upper and lower end) of the slider position.r)r}r2rrrr r r r sz Scrollbar.getcCs|j|jd||dS)ziSet the fractional values of the slider position (upper and lower ends as value between 0 and 1).rNrrr r r r sz Scrollbar.set)N) rArBrCrkrrrPrr-rrr r r r r. s r.c@seZdZdZdifddZddZddZd d Zdkd d Zdld dZ ddZ dmddZ ddZ dnddZ ddZddZddZddZdodd Zd!d"Zdpd#d$Zifd%d&Zd'd(Zd)d*Zd+d,Zdqd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zifd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#drdCdDZ$dEdFZ%dGdHZ&dsdIdJZ'dtdKdLZ(dMdNZ)dudOdPZ*e*Z+dQdRZ,dvdSdTZ-dwdUdVZ.dxdWdXZ/dydYdZZ0dzd[d\Z1d]d^Z2d{d_d`Z3dadbZ4d|dcddZ5e5Z6ifdedfZ7dgdhZ8didjZ9dS)}Textz4Text widget which can display text in various forms.NcKst||d||dS)aConstruct a text widget with the parent MASTER. STANDARD OPTIONS background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, padx, pady, relief, selectbackground, selectborderwidth, selectforeground, setgrid, takefocus, xscrollcommand, yscrollcommand, WIDGET-SPECIFIC OPTIONS autoseparators, height, maxundo, spacing1, spacing2, spacing3, state, tabs, undo, width, wrap, rNrrr r r r sz Text.__init__cCs||j|jd|pdS)zReturn a tuple of (x,y,width,height) which gives the bounding box of the visible part of the character at the given index.rNrArr r r r s z Text.bboxc Cs|j|j|jd|||S)zReturn whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.comparer*)rer opr!r r r r0 s z Text.comparecGsVdd|D}|||g7}|jj|jdf|p2d}|dk rNt|dkrN|fS|SdS)aCounts the number of relevant things between the two indices. If index1 is after index2, the result will be a negative number (and this holds for each of the possible options). The actual items which are counted depends on the options given by args. The result is a list of integers, one for the result of each counting option given. Valid counting options are "chars", "displaychars", "displayindices", "displaylines", "indices", "lines", "xpixels" and "ypixels". There is an additional possible option "update", which if given then all subsequent options ensure that any possible out of date information is recalculated.cSsg|]}|dsd|qS)r-r) startswith)rJargr r r rs zText.count..r|N)r2rrr)rer r!rrr r r r| s  z Text.countcCs6|dkr |j|j|jdS|j|jd|dS)zjTurn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.Ndebugr*rr r r r5 sz Text.debugcCs|j|jd||dS)z?Delete the characters between INDEX1 and INDEX2 (not included).rNrrer r!r r r rsz Text.deletecCs||j|jd|S)zReturn tuple (x,y,width,height,baseline) giving the bounding box and baseline position of the visible part of the line containing the character at INDEX. dlineinforArr r r r7szText.dlineinfoc Ksg}d}d}|s$g}|fdd}|}zzt|ts>||}}|d|g7}|D]} || rN|d| qN|||r|||jj|jdf||WS|r||XdS)aReturn the contents of the widget between index1 and index2. The type of contents returned in filtered based on the keyword parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are given and true, then the corresponding items are returned. The result is a list of triples of the form (key, value, index). If none of the keywords are true then 'all' is used by default. If the 'command' argument is given, it is called once for each element of the list of triples, with the values of each triple serving as the arguments to the function. In this case the list is not returned.NcSs||||fdSr)rc)r6r rr%r r r append_triple/sz Text.dump..append_triplez-commandr-dump)rrrrrcr2rr) rer r!rrrZ func_namer%r8r6r r r r9s*      z Text.dumpcGs|jj|jdf|S)arInternal method This method controls the undo mechanism and the modified flag. The exact behavior of the command depends on the option argument that follows the edit argument. The following forms of the command are currently supported: edit_modified, edit_redo, edit_reset, edit_separator and edit_undo editrrr r r r:Bs z Text.editcCs |d|S)a;Get or Set the modified flag If arg is not specified, returns the modified flag of the widget. The insert, delete, edit undo and edit redo commands or the user can set or clear the modified flag. If boolean is specified, sets the modified flag of the widget to arg. Zmodifiedr:)rer3r r r edit_modifiedQs zText.edit_modifiedcCs |dS)a Redo the last undone edit When the undo option is true, reapplies the last undone edits provided no other edits were done since then. Generates an error when the redo stack is empty. Does nothing when the undo option is false. Zredor;rr r r edit_redo\szText.edit_redocCs |dS)z(Clears the undo and redo stacks resetr;rr r r edit_resetfszText.edit_resetcCs |dS)znInserts a separator (boundary) on the undo stack. Does nothing when the undo option is false rr;rr r r edit_separatorkszText.edit_separatorcCs |dS)aDUndoes the last edit action If the undo option is true. An edit action is defined as all the insert and delete commands that are recorded on the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the undo option is false Zundor;rr r r edit_undors zText.edit_undocCs|j|jd||S)z5Return the text from INDEX1 to INDEX2 (not included).rrr6r r r r}szText.getcCsJ|dddkrd|}|dddkr4|dd}|j|jdd||S)z9Return the value of OPTION of an embedded image at INDEX.Nrr-rrrrrr r r r image_cgets  zText.image_cgetcKs|dd|f||S)z%Configure an embedded image at INDEX.rrrrr r r image_configureszText.image_configurecKs"|jj|jdd|f|||S)z"Create an embedded image at INDEX.rr@rirr r r image_creates zText.image_createcCs|j|jddS)z3Return all names of embedded images in this widget.rrrrr r r rszText.image_namescCst|j|jd|S)z1Return the index in the form line.char for INDEX.r)rr2rrrr r r rsz Text.indexcGs|j|jd||f|dS)zInsert CHARS before the characters at INDEX. An additional tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.rNr)rercharsrr r r rsz Text.insertcCs|j|jdd||fS)zChange the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT). Return the current value if None is given for DIRECTION.rZgravityr)remarkName directionr r r mark_gravityszText.mark_gravitycCs|j|j|jddS)zReturn all mark names.rrrhrr r r mark_namess  zText.mark_namescCs|j|jdd||dS)z0Set mark MARKNAME before the character at INDEX.rrNr)rerFrr r r mark_setsz Text.mark_setcGs|j|jddf|dS)zDelete all marks in MARKNAMES.rZunsetNr)reZ markNamesr r r mark_unsetszText.mark_unsetcCs|j|jdd|pdS)z-Return the name of the next mark after INDEX.rnextNrrr r r mark_nextszText.mark_nextcCs|j|jdd|pdS)z2Return the name of the previous mark before INDEX.rZpreviousNrrr r r mark_previousszText.mark_previouscKs&|jj|jdd|f|||dS)aCreates a peer text widget with the given newPathName, and any optional standard configuration options. By default the peer will have the same start and end line as the parent widget, but these can be overridden with the standard configuration options.peerr@Nri)reZ newPathNamer&rr r r peer_creates zText.peer_createcCs|j|j|jddS)zYReturns a list of peers of this widget (this does not include the widget itself).rOrrhrr r r peer_namesszText.peer_namescGs |jj|jd|||f|dS)zReplaces the range of characters between index1 and index2 with the given characters and tags specified by args. See the method insert for some more information about args, and the method delete for information about the indices.rNr)rer r!rErr r r rsz Text.replacecCs|j|jdd||dSrrrr r r rszText.scan_markcCs|j|jdd||dS)z~Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.rrNrrr r r rszText.scan_dragtoc Cs|jdg} |r| d|r&| d|r4| d|rB| d|rP| d| r^| d| rv| d| | |r|d d kr| d | || ||r| |t|jt| S) zSearch PATTERN beginning from INDEX until STOPINDEX. Return the index of the first character of a match or an empty string.rz -forwardsz -backwardsz-exactz-regexpz-nocasez-elidez-countrr-r)rrcrr2rr) rerrZ stopindexZforwardsZ backwardsexactZregexpZnocaser|Zeliderr r r rs.            z Text.searchcCs|j|jd|dS)z3Scroll such that the character at INDEX is visible.rNrrr r r rszText.seecGs |j|jdd||f|dS)z|Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS. Additional pairs of indices may follow in ARGS.tagrNr)retagNamer rr r r tag_addsz Text.tag_addcCs*|j|jdd||d|r&||dS)zgUnbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.rSrprZNrs)rerTrlrnr r r rszText.tag_unbindcCs||jdd|f|||S)a+Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.rSrprq)rerTrlrrr r r rs z Text.tag_bindcCsJ|dddkrd|}|dddkr4|dd}|j|jdd||S)z+Return the value of OPTION for tag TAGNAME.Nrr-rrrSrr)rerTrr r r tag_cget s  z Text.tag_cgetcKs|dd|f||S)zConfigure a tag TAGNAME.rSrr)rerTr&rr r r tag_configureszText.tag_configurecGs|j|jddf|dS)zDelete all tags in TAGNAMES.rSrNr)reZtagNamesr r r tag_deleteszText.tag_deletecCs|j|jdd||dS)z`Change the priority of tag TAGNAME such that it is lower than the priority of BELOWTHIS.rSrNr)rerTrr r r rszText.tag_lowercCs|j|j|jdd|S)zReturn a list of all tag names.rSrrhrr r r tag_names szText.tag_namesc Cs |j|j|jdd|||S)zReturn a list of start and end index for the first sequence of characters between INDEX1 and INDEX2 which all have tag TAGNAME. The text is searched forward from INDEX1.rSZ nextrangerhrerTr r!r r r tag_nextrange%s zText.tag_nextrangec Cs |j|j|jdd|||S)zReturn a list of start and end index for the first sequence of characters between INDEX1 and INDEX2 which all have tag TAGNAME. The text is searched backwards from INDEX1.rSZ prevrangerhrZr r r tag_prevrange,s zText.tag_prevrangecCs|j|jdd||dS)zaChange the priority of tag TAGNAME such that it is higher than the priority of ABOVETHIS.rSrNr)rerTrr r r r3szText.tag_raisecCs|j|j|jdd|S)z7Return a list of ranges of text which have tag TAGNAME.rSZrangesrh)rerTr r r tag_ranges9s  zText.tag_rangescCs|j|jdd|||dS)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.rSrNrrZr r r tag_remove>szText.tag_removecCsJ|dddkrd|}|dddkr4|dd}|j|jdd||S)z:Return the value of OPTION of an embedded window at INDEX.Nrr-rrrrrr r r r window_cgetCs  zText.window_cgetcKs|dd|f||S)z&Configure an embedded window at INDEX.rrrrr r r window_configureKszText.window_configurecKs&|j|jdd|f|||dS)zCreate a window at INDEX.rr@Nrirr r r window_createQs   zText.window_createcCs|j|j|jddS)z4Return all names of embedded windows in this widget.rrrhrr r r window_namesWszText.window_namescGs|j|jddf|dS)zObsolete function, use see.rz -pickplaceNr)rerqr r r yview_pickplace\szText.yview_pickplace)N)N)NN)N)N)N)N)NNNNNNNN)N)N)N)N)N)N)N)N)N)N):rArBrCrkrrr0r|r5rr7r9r:r<r=r?r@rArrBrCrDrrrrHrIrJrKrMrNrPrQrrrrrrUrrrVrWZ tag_configrXrrYr[r\rr]r^r_r`Z window_configrarbrcr r r r r/ s~   (                   r/c@s"eZdZdZdddZddZdS)_setitz>Internal class. It wraps the command in the widget OptionMenu.NcCs||_||_||_dSr) _setit__value _setit__var_setit__callback)revarr rr r r rdsz_setit.__init__cGs*|j|j|jr&|j|jf|dSr)rfrrergrr r r risz_setit.__call__)Nrr r r r rdas rdc@s(eZdZdZddZddZddZdS) OptionMenuz?OptionMenu which allows the user to select a value from a menu.c Osd|dtddd}t||d|d|_t|ddd }|_|j|_|d }d |kr\|d =|rtt d t t ||j |t |||d |D]} |j | t || |d q||d<d S)zConstruct an optionmenu widget with the parent MASTER, with the resource textvariable set to VARIABLE, the initially selected value VALUE, the other menu values VALUES and an additional keyword argument command.r,rr')Z borderwidthZ textvariableZ indicatoronZreliefrZhighlightthicknessr(Z tk_optionMenur r)rYZtearoffrzunknown option -)rrN)ZRAISEDrrr~r _OptionMenu__menurZmenunamerrrLr0rrd) rerrr rRkwargsrr rr*r r r rrs.   zOptionMenu.__init__cCs|dkr|jSt||S)Nr )rjrrrr r r rszOptionMenu.__getitem__cCst|d|_dS)z,Destroy this widget and the associated menu.N)r'rrjrr r r rs zOptionMenu.destroyN)rArBrCrkrrrr r r r riosric@sheZdZdZdZdidfddZddZdd Zd d Zd d Z ddZ e Z ddZ ddZ ddZdS)ImagezBase class for images.rNc Ksd|_|std}t|d||_|s>tjd7_dtjf}|rT|rTt||f}n|r\|}d}|D]*\}}t|r| |}|d||f}qh|j dd||f|||_dS) Nz create imager2rz pyimage%rr r-rr@) rYrsr`r2rl_last_idr+r%rrr) reZimgtyperYr&rrrr)r*r r r rs$  zImage.__init__cCs|jSr)rYrr r r rFz Image.__str__cCs6|jr2z|jdd|jWntk r0YnXdS)Nrr)rYr2rrrr r r rs z Image.__del__cCs|j|jdd||dSNrr-r2rrYrr r r rszImage.__setitem__cCs|j|jdd|Srorprr r r rszImage.__getitem__cKsvd}t|D]J\}}|dk r|ddkr8|dd}t|rJ||}|d||f}q|j|jdf|dS)zConfigure the image.r Nrrr-r)r+r%rrr2rrY)rerrr)r*r r r rs  zImage.configurecCs|j|jdd|jS)zReturn the height of the image.rrXr2rrrYrr r r rXsz Image.heightcCs|jdd|jS)z7Return the type of the image, e.g. "photo" or "bitmap".rr rprr r r r sz Image.typecCs|j|jdd|jS)zReturn the width of the image.rrWrqrr r r rWsz Image.width)rArBrCrkrmrrFrrrrrrXr rWr r r r rls rlc@seZdZdZdidfddZddZddZd d Zd d ZdddZ dddZ ddZ dddZ dddZ ddZddZdS) PhotoImagez=Widget which can display images in PGM, PPM, GIF, PNG format.NcKstj|d|||f|dS)ztCreate an image with NAME. Valid resource names: data, format, file, gamma, height, palette, width.ZphotoNrlrrerYr&rrr r r rszPhotoImage.__init__cCs|j|jddS)zDisplay a transparent image.blankNrprr r r ruszPhotoImage.blankcCs|j|jdd|S)zReturn the value of OPTION.rr-rp)rerr r r rszPhotoImage.cgetcCs|j|jdd|S)Nrr-rprr r r rszPhotoImage.__getitem__cCs"t|jd}|j|d|j|S)z;Return a new PhotoImage with the same image as this widget.rcopyrrr2rrY)re destImager r r rvs zPhotoImage.copyrZcCs4t|jd}|dkr|}|j|d|jd|||S)zReturn a new PhotoImage with the same image as this widget but zoom it with a factor of x in the X direction and y in the Y direction. If y is not given, the default value is the same as x. rrZrvz-zoomrwrerUrVrxr r r zooms  zPhotoImage.zoomcCs4t|jd}|dkr|}|j|d|jd|||S)zReturn a new PhotoImage based on the same image as this widget but use only every Xth or Yth pixel. If y is not given, the default value is the same as x. rrZrvz -subsamplerwryr r r subsamples  zPhotoImage.subsamplecCs|j|jd||S)z8Return the color (red, green, blue) of the pixel at X,Y.rrprr r r r szPhotoImage.getcCsH|jd|f}|r8|ddkr(|dd}|dt|}|j|dS)zzPut row formatted colors to image starting from position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))putr-torN)r}rYrr2r)rerrrr r r r| s    zPhotoImage.putcCs@|jd|f}|r|d|f}|r0|dt|}|j|dS)zRWrite image to file FILENAME in FORMAT starting from position FROM_COORDS.writez-format)z-fromNr~)refilenameformatZ from_coordsrr r r rs   zPhotoImage.writec Cs|j|j|jdd||S)z/Return True if the pixel at x,y is transparent. transparencyr)r2rrrYrr r r transparency_get"s zPhotoImage.transparency_getcCs|j|jdd|||dS)z)Set the transparency of the pixel at x,y.rrNrp)rerUrVrr r r transparency_set'szPhotoImage.transparency_set)rZ)rZ)N)NN)rArBrCrkrrurrrvrzr{rr|rrrr r r r rrs  rrc@s eZdZdZdidfddZdS) BitmapImagez.Widget which can display images in XBM format.NcKstj|d|||f|dS)zqCreate a bitmap with NAME. Valid resource names: background, data, file, foreground, maskdata, maskfile.rNrsrtr r r r/szBitmapImage.__init__rr r r r r,srcCstdj}||ddS)Nzuse image_names()rrrsr2r.rr2r r r r6s rcCstdj}||ddS)Nzuse image_types()rrrrr r r r;s rc@seZdZdZdifddZddZd+ddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd,d!d"Zd#d$Zd%d&Zd'd(Zd)d*ZdS)-Spinboxzspinbox widget.NcKst||d||dS)aConstruct a spinbox widget with the parent MASTER. STANDARD OPTIONS activebackground, background, borderwidth, cursor, exportselection, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, justify, relief, repeatdelay, repeatinterval, selectbackground, selectborderwidth selectforeground, takefocus, textvariable xscrollcommand. WIDGET-SPECIFIC OPTIONS buttonbackground, buttoncursor, buttondownrelief, buttonuprelief, command, disabledbackground, disabledforeground, format, from, invalidcommand, increment, readonlybackground, state, to, validate, validatecommand values, width, wrap, ZspinboxNrrr r r rCszSpinbox.__init__cCs||j|jd|pdS)aReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses the character given by index. The first two elements of the list give the x and y coordinates of the upper-left corner of the screen area covered by the character (in pixels relative to the widget) and the last two elements give the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. rNrArr r r r`s z Spinbox.bboxcCs|j|jd||S)aWDelete one or more elements of the spinbox. First is the index of the first character to delete, and last is the index of the character just after the last one to delete. If last isn't specified it defaults to first+1, i.e. a single character is deleted. This command returns an empty string. rrrr r r rns zSpinbox.deletecCs|j|jdS)zReturns the spinbox's stringrrrr r r rysz Spinbox.getcCs|j|jd|S)zAlter the position of the insertion cursor. The insertion cursor will be displayed just before the character given by index. Returns an empty string rrrr r r r}szSpinbox.icursorcCs|j|jd||S)z{Returns the name of the widget at position x, y Return value is one of: none, buttondown, buttonup, entry r-rrr r r r-szSpinbox.identifycCs|j|jd|S)z;Returns the numerical index corresponding to index rrrr r r rsz Spinbox.indexcCs|j|jd||S)zDInsert string s at index Returns an empty string. rr)rerrfr r r rszSpinbox.insertcCs|j|jd|S)zCauses the specified element to be invoked The element could be buttondown or buttonup triggering the action associated with it. rrreelementr r r rszSpinbox.invokecGs ||j|jdf|pdS)rrr rArr r r rs z Spinbox.scancCs |d|S)zRecords x and the current view in the spinbox window; used in conjunction with later scan dragto commands. Typically this command is associated with a mouse button press in the widget. It returns an empty string. rrr^r r r rszSpinbox.scan_markcCs |d|S)aCompute the difference between the given x argument and the x argument to the last scan mark command It then adjusts the view left or right by 10 times the difference in x-coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the spinbox at high speed through the window. The return value is an empty string. rrr^r r r rs zSpinbox.scan_dragtocGs ||j|jdf|pdS)rr r rArr r r r s zSpinbox.selectioncCs |d|S)aLocate the end of the selection nearest to the character given by index, Then adjust that end of the selection to be at index (i.e including but not going beyond index). The other end of the selection is made the anchor point for future select to commands. If the selection isn't currently in the spinbox, then a new selection is created to include the characters between index and the most recent selection anchor point, inclusive. rr rr r r rs zSpinbox.selection_adjustcCs |dS)zsClear the selection If the selection isn't in this widget then the command has no effect. rrrr r r rszSpinbox.selection_clearcCs|j|jdd|S)zSets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed. r rrrr r r selection_elementszSpinbox.selection_elementcCs|d|dS)rrNrrr r r rszSpinbox.selection_fromcCs|j|j|jddS)zUReturn True if there are characters selected in the spinbox, False otherwise.r rr*rr r r rszSpinbox.selection_presentcCs|d||dS)rrNrrr r r rszSpinbox.selection_rangecCs|d|dS)rrNrrr r r rszSpinbox.selection_to)N)N)rArBrCrkrrrrrr-rrrrrrr rrrrrrrr r r r r@s*    rc@seZdZdZdifddZdS) LabelFramezlabelframe widget.NcKst||d||dS)aConstruct a labelframe widget with the parent MASTER. STANDARD OPTIONS borderwidth, cursor, font, foreground, highlightbackground, highlightcolor, highlightthickness, padx, pady, relief, takefocus, text WIDGET-SPECIFIC OPTIONS background, class, colormap, container, height, labelanchor, labelwidget, visual, width Z labelframeNrrr r r rszLabelFrame.__init__rr r r r rsrc@seZdZdZdifddZddZddZeZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZddZd!ddZeZdd ZdS)" PanedWindowzpanedwindow widget.NcKst||d||dS)aTConstruct a panedwindow widget with the parent MASTER. STANDARD OPTIONS background, borderwidth, cursor, height, orient, relief, width WIDGET-SPECIFIC OPTIONS handlepad, handlesize, opaqueresize, sashcursor, sashpad, sashrelief, sashwidth, showhandle, Z panedwindowNrrr r r r szPanedWindow.__init__cKs"|j|jd|f||dS)a+Add a child widget to the panedwindow in a new pane. The child argument is the name of the child widget followed by pairs of arguments that specify how to manage the windows. The possible options and values are the ones accepted by the paneconfigure method. rNri)rer&rr r r rszPanedWindow.addcCs|j|jd|dS)zRemove the pane containing child from the panedwindow All geometry management options for child will be forgotten. rNr)rer&r r r r'szPanedWindow.removecCs|j|jd||S)aIdentify the panedwindow component at point x, y If the point is over a sash or a sash handle, the result is a two element list containing the index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as {0 sash} or {2 handle}. If the point is over any other part of the panedwindow, the result is an empty list. r-rrr r r r-0s zPanedWindow.identifycGs ||j|jdf|pdS)rproxyr rArr r r r<s zPanedWindow.proxycCs |dS)zBReturn the x and y pair of the most recent proxy location coordrrr r r proxy_coordAszPanedWindow.proxy_coordcCs |dS)z+Remove the proxy from the display. rrrr r r proxy_forgetFszPanedWindow.proxy_forgetcCs|d||S)z:Place the proxy at the given x and y coordinates. rrrr r r proxy_placeKszPanedWindow.proxy_placecGs ||j|jdf|pdS)rsashr rArr r r rPs zPanedWindow.sashcCs |d|S)aAReturn the current x and y pair for the sash given by index. Index must be an integer between 0 and 1 less than the number of panes in the panedwindow. The coordinates given are those of the top left corner of the region containing the sash. pathName sash dragto index x y This command computes the difference between the given coordinates and the coordinates given to the last sash coord command for the given sash. It then moves that sash the computed difference. The return value is the empty string. rrrr r r sash_coordUs zPanedWindow.sash_coordcCs |d|S)zRecords x and y for the sash given by index; Used in conjunction with later dragto commands to move the sash. rrrr r r sash_markcszPanedWindow.sash_markcCs|d|||S)z?Place the sash given by index at the given coordinates rr)rerrUrVr r r sash_placejszPanedWindow.sash_placecCs|j|jdf|d|fS)zwQuery a management option for window. Option may be any value allowed by the paneconfigure subcommand panecgetr-r)rer&rr r r roszPanedWindow.panecgetcKsd|dkr|s||jd|St|tr@|s@||jd|d|S|j|jd|f|||dS)a Query or modify the management options for window. If no option is specified, returns a list describing all of the available options for pathName. If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. The following options are supported: after window Insert the window after the window specified. window should be the name of a window already managed by pathName. before window Insert the window before the window specified. window should be the name of a window already managed by pathName. height size Specify a height for the window. The height will be the outer dimension of the window including its border, if any. If size is an empty string, or if -height is not specified, then the height requested internally by the window will be used initially; the height may later be adjusted by the movement of sashes in the panedwindow. Size may be any value accepted by Tk_GetPixels. minsize n Specifies that the size of the window cannot be made less than n. This constraint only affects the size of the widget in the paned dimension -- the x dimension for horizontal panedwindows, the y dimension for vertical panedwindows. May be any value accepted by Tk_GetPixels. padx n Specifies a non-negative value indicating how much extra space to leave on each side of the window in the X-direction. The value may have any of the forms accepted by Tk_GetPixels. pady n Specifies a non-negative value indicating how much extra space to leave on each side of the window in the Y-direction. The value may have any of the forms accepted by Tk_GetPixels. sticky style If a window's pane is larger than the requested dimensions of the window, this option may be used to position (or stretch) the window within its pane. Style is a string that contains zero or more of the characters n, s, e or w. The string can optionally contains spaces or commas, but they are ignored. Each letter refers to a side (north, south, east, or west) that the window will "stick" to. If both n and s (or e and w) are specified, the window will be stretched to fill the entire height (or width) of its cavity. width size Specify a width for the window. The width will be the outer dimension of the window including its border, if any. If size is an empty string, or if -width is not specified, then the width requested internally by the window will be used initially; the width may later be adjusted by the movement of sashes in the panedwindow. Size may be any value accepted by Tk_GetPixels. N paneconfigurer-)rrrrrr2rrrr r r rwsD  zPanedWindow.paneconfigurecCs|j|j|jdS)z+Returns an ordered list of the child panes.panesrhrr r r rszPanedWindow.panes)N)rArBrCrkrrrrr-rrrrrrrrrrZ paneconfigrr r r r r s$   LrcCst}dt}|d7}t||d}|t|d|fddd}|||_t|d|jd}|||| | dS) NzThis is Tcl/Tk version %su This should be a cedilla: çrz Click me!cSs|jjd|jddS)Nz[%s]rr)testr)rrr r r s z_test..)rrZQUIT) ro TclVersionrrrDrrrr!rr)rrrrrr{r r r _tests   r__main__)TN)N)r)r)NNror)VrkenumrrrZtkinter.constantsrerAfloatrPZ TkVersionrQrZREADABLEZWRITABLEZ EXCEPTIONcompilerASCIIrr rrr"r+r7rEnumr8rGrlrmrnrsrvrzrr{rrrrrrarrrrrrrrrorgrhrqrvr{rrrDrrrrrrr r'r)r+r,r.r/rdrirlrrrrrrrrrrAr r r r s        ,R  6  q2~ .37?/8$Vt!'2'BT 3C usr/lib64/python3.8/dbm/__pycache__/__init__.cpython-38.pyc000064400000010142152365005730017214 0ustar00U e5d@sdZdddgZddlZddlZddlZddlZGdddeZddd gZda iZ ee fZzdd l m Z Wnek rdZ YnXdd dZddZedkrejddD]ZeeepdeqdS)aNGeneric interface to all dbm clones. Use import dbm d = dbm.open(file, 'w', 0o666) The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the type of database being opened (determined by the whichdb function) in the case of an existing dbm. If the dbm does not exist and the create or new flag ('c' or 'n') was specified, the dbm type will be determined by the availability of the modules (tested in the above order). It has the following interface (key and data are strings): d[key] = data # store data at key (may override data at # existing key) data = d[key] # retrieve data at key (raise KeyError if no # such key) del d[key] # delete data stored at key (raises KeyError # if no such key) flag = key in d # true if the key exists list = d.keys() # return a list of all existing keys (slow!) Future versions may change the order in which implementations are tested for existence, and add interfaces to other dbm-like implementations. openwhichdberrorNc@s eZdZdS)rN)__name__ __module__ __qualname__rr$/usr/lib64/python3.8/dbm/__init__.pyr&sdbm.gnudbm.ndbmdbm.dumb)ndbmrc Cstdkr^tD]@}zt|dgd}Wntk r:Yq YnXtsD|a|t|<q ts^tdtd|krnt|nd}|dkrd|ksd|krt}qtddn:|d krtdd n$|tkrtdd |nt|}||||S) aOpen or create database at path given by *file*. Optional argument *flag* can be 'r' (default) for read-only access, 'w' for read-write access of an existing database, 'c' for read-write access to a new or existing database, and 'n' for read-write access to a new database. Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it only if it doesn't exist; and 'n' always creates a new database. Nr)fromlistzno dbm clone found; tried %sncrz=db file doesn't exist; use 'c' or 'n' flag to create a new dbzdb type could not be determinedz/db type is {0}, but the module is not available) _defaultmod_names __import__ ImportError_modulesrrformatr)fileflagmodenamemodresultrrr r5s0     c Csz6t|dd}|t|dd}|WdStk rz>t|dd}|tdk rt|}|WYdSWntk rYnXYnXzht|dt|dj}|dkrWd St|dd}z|d d krW Wd SW5|XWntk rYnXzt|d}Wntk rHYdSX||d }W5QRX|dd }t |d krdSzt d|\}Wnt j k rYdSX|dkrdSzt d|dd\}Wnt j k rYdSXdS)auGuess which db package to use to open a db file. Return values: - None if the database file can't be read; - empty string if the file can be read but can't be recognized - the name of the dbm submodule (e.g. "ndbm" or "gnu") if recognized. Importing the given module may still fail, and opening the database using that module may still fail. z.pagrbz.dirr z.dbNz.datrr )'"rz=l)iΚWi͚WiϚWr ) iorcloseOSErrorr osstatst_sizereadlenstructZunpackr)filenamefdsizeZs16smagicrrr rbs`     __main__r!ZUNKNOWN)rr)__doc____all__r'r*r/sys Exceptionrrrrr)Zdbmr rrrrargvr0printrrrr s&    -Ylib64/python3.8/distutils/command/__pycache__/__init__.cpython-38.pyc000064400000001041152366436510021306 0ustar00U e5d@s2dZddddddddd d d d d ddddddgZdS)z\distutils.command Package containing implementation of all the standard Distutils commands.ZbuildZbuild_pyZ build_extZ build_clibZ build_scriptsZcleanZinstallZ install_libZinstall_headersZinstall_scriptsZ install_dataZsdistregisterZbdistZ bdist_dumbZ bdist_rpmZ bdist_wininstZcheckZuploadN)__doc____all__rr2/usr/lib64/python3.8/distutils/command/__init__.pys(lib64/python3.8/distutils/__pycache__/__init__.cpython-38.pyc000064400000000602152367246130017670 0ustar00U e5d@s&dZddlZejdejdZdS)zdistutils The main package for the Python Module Distribution Utilities. Normally used from a setup script as from distutils.core import setup setup (...) N )__doc__sysversionindex __version__rr*/usr/lib64/python3.8/distutils/__init__.pys lib64/python3.8/http/__pycache__/__init__.cpython-38.pyc000064400000013662152370022730016625 0ustar00U e5d@s&ddlmZdgZGdddeZdS))IntEnum HTTPStatusc@seZdZdZdAddZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;dZ>d?Z?d@S)BraHTTP status codes and reason phrases Status codes from the following RFCs are all observed: * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616 * RFC 6585: Additional HTTP Status Codes * RFC 3229: Delta encoding in HTTP * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518 * RFC 5842: Binding Extensions to WebDAV * RFC 7238: Permanent Redirect * RFC 2295: Transparent Content Negotiation in HTTP * RFC 2774: An HTTP Extension Framework * RFC 7725: An HTTP Status Code to Report Legal Obstacles * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2) cCs"t||}||_||_||_|S)N)int__new___value_phrase description)clsvaluerr objr %/usr/lib64/python3.8/http/__init__.pyrs  zHTTPStatus.__new__)dZContinuez!Request received, please continue)ezSwitching Protocolsz.Switching to new protocol; obey Upgrade header)fZ Processing)OKz#Request fulfilled, document follows)ZCreatedzDocument created, URL follows)ZAcceptedz/Request accepted, processing continues off-line)zNon-Authoritative InformationzRequest fulfilled from cache)z No Contentz"Request fulfilled, nothing follows)z Reset Contentz"Clear input form for further input)zPartial ContentzPartial content follows)z Multi-Status)zAlready Reported)zIM Used)i,zMultiple Choicesz,Object has several resources -- see URI list)i-zMoved Permanently(Object moved permanently -- see URI list)i.ZFound(Object moved temporarily -- see URI list)i/z See Otherz'Object moved -- see Method and URL list)i0z Not Modifiedz)Document has not changed since given time)i1z Use Proxyz@You must use proxy specified in Location to access this resource)i3zTemporary Redirectr)i4zPermanent Redirectr)iz Bad Requestz(Bad request syntax or unsupported method)iZ Unauthorizedz*No permission -- see authorization schemes)izPayment Requiredz"No payment -- see charging schemes)iZ Forbiddenz0Request forbidden -- authorization will not help)iz Not FoundzNothing matches the given URI)izMethod Not Allowedz-Specified method is invalid for this resource)izNot Acceptablez%URI not available in preferred format)izProxy Authentication Requiredz7You must authenticate with this proxy before proceeding)izRequest Timeoutz"Request timed out; try again later)iZConflictzRequest conflict)iZGonez5URI no longer exists and has been permanently removed)izLength Requiredz"Client must specify Content-Length)izPrecondition Failedz Precondition in headers is false)izRequest Entity Too LargezEntity is too large)izRequest-URI Too LongzURI is too long)izUnsupported Media Typez!Entity body in unsupported format)izRequested Range Not SatisfiablezCannot satisfy request range)izExpectation Failedz'Expect condition could not be satisfied)izMisdirected Requestz(Server is not able to produce a response)izUnprocessable Entity)iZLocked)izFailed Dependency)izUpgrade Required)izPrecondition Requiredz8The origin server requires the request to be conditional)izToo Many RequestszOThe user has sent too many requests in a given amount of time ("rate limiting"))izRequest Header Fields Too LargezVThe server is unwilling to process the request because its header fields are too large)izUnavailable For Legal ReasonszOThe server is denying access to the resource as a consequence of a legal demand)izInternal Server ErrorzServer got itself in trouble)izNot Implementedz&Server does not support this operation)iz Bad Gatewayz+Invalid responses from another server/proxy)izService Unavailablez8The server cannot process the request due to a high load)izGateway Timeoutz4The gateway server did not receive a timely response)izHTTP Version Not SupportedzCannot fulfill request)izVariant Also Negotiates)izInsufficient Storage)iz Loop Detected)iz Not Extended)izNetwork Authentication Requiredz7The client needs to authenticate to gain network accessN)r)@__name__ __module__ __qualname____doc__rZCONTINUEZSWITCHING_PROTOCOLSZ PROCESSINGrZCREATEDZACCEPTEDZNON_AUTHORITATIVE_INFORMATIONZ NO_CONTENTZ RESET_CONTENTZPARTIAL_CONTENTZ MULTI_STATUSZALREADY_REPORTEDZIM_USEDZMULTIPLE_CHOICESZMOVED_PERMANENTLYZFOUNDZ SEE_OTHERZ NOT_MODIFIEDZ USE_PROXYZTEMPORARY_REDIRECTZPERMANENT_REDIRECTZ BAD_REQUESTZ UNAUTHORIZEDZPAYMENT_REQUIREDZ FORBIDDENZ NOT_FOUNDZMETHOD_NOT_ALLOWEDZNOT_ACCEPTABLEZPROXY_AUTHENTICATION_REQUIREDZREQUEST_TIMEOUTZCONFLICTZGONEZLENGTH_REQUIREDZPRECONDITION_FAILEDZREQUEST_ENTITY_TOO_LARGEZREQUEST_URI_TOO_LONGZUNSUPPORTED_MEDIA_TYPEZREQUESTED_RANGE_NOT_SATISFIABLEZEXPECTATION_FAILEDZMISDIRECTED_REQUESTZUNPROCESSABLE_ENTITYZLOCKEDZFAILED_DEPENDENCYZUPGRADE_REQUIREDZPRECONDITION_REQUIREDZTOO_MANY_REQUESTSZREQUEST_HEADER_FIELDS_TOO_LARGEZUNAVAILABLE_FOR_LEGAL_REASONSZINTERNAL_SERVER_ERRORZNOT_IMPLEMENTEDZ BAD_GATEWAYZSERVICE_UNAVAILABLEZGATEWAY_TIMEOUTZHTTP_VERSION_NOT_SUPPORTEDZVARIANT_ALSO_NEGOTIATESZINSUFFICIENT_STORAGEZ LOOP_DETECTEDZ NOT_EXTENDEDZNETWORK_AUTHENTICATION_REQUIREDr r r rrsz N)enumr__all__rr r r rs lib64/python3.8/importlib/__pycache__/__init__.cpython-38.pyc000064400000007260152370435310017646 0ustar00U e5d@sjdZddddgZddlZddlZz ddlZWn,ek rXddlmZeeeYn@Xd e_ d e_ ze d d e_ Wne k rYnXeejd <z ddlZWn0ek rdd lmZeeee_YnBXde_ d e_ ze d de_ Wne k r YnXeejd<ejZejZddlZddlZddlmZddZdddZdddZiZddZdS)z'A pure Python implementation of import. __import__ import_moduleinvalidate_cachesreloadN) _bootstrapzimportlib._bootstrap importlibz __init__.pyz _bootstrap.py)_bootstrap_externalzimportlib._bootstrap_externalz_bootstrap_external.py)rcCs"tjD]}t|dr|qdS)zmCall the invalidate_caches() method on all meta path finders stored in sys.meta_path (where implemented).rN)sys meta_pathhasattrr)finderr*/usr/lib64/python3.8/importlib/__init__.pyrBs  cCstjdtddz.tj|j}|dkr6td|n|WSWn6tk rRYn$t k rttd|dYnXt ||}|dkrdS|j dkr|j dkrtd||dtd |d|j S) zReturn the loader for the specified module. This is a backward-compatible wrapper around find_spec(). This function is deprecated in favor of importlib.util.find_spec(). zDDeprecated since Python 3.4. Use importlib.util.find_spec() instead.) stacklevelNz{}.__loader__ is Nonez{}.__loader__ is not setzspec for {} missing loadernamez&namespace packages do not have loaders)warningswarnDeprecationWarningr modules __loader__ ValueErrorformatKeyErrorAttributeErrorr _find_specloadersubmodule_search_locations ImportError)rpathrspecrrr find_loaderJs2      r#cCsXd}|drB|s$d}t|||D]}|dkr8qB|d7}q(t||d||S)zImport a module. The 'package' argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import. r.zHthe 'package' argument is required to perform a relative import for {!r}rN) startswith TypeErrorrr _gcd_import)rpackagelevelmsg characterrrrrms  cCsP|rt|tjstdz |jj}Wntk r>|j}YnXtj ||k rfd}t | ||d|t krvt |S|t |<z|dd}|rztj |}Wn,tk rd}t | ||ddYqX|j}nd}|}t|||}|_|dkrtd||dt||tj |WSz t |=Wntk rHYnXXdS) zcReload the module and return it. The module must have been successfully imported before. z"reload() argument must be a modulezmodule {} not in sys.modulesrr$rzparent {!r} not in sys.modulesNzspec not found for the module ) isinstancetypes ModuleTyper&__spec__rr__name__r rgetr r _RELOADINGr rpartition__path__rrModuleNotFoundError_exec)modulerr* parent_nameparentpkgpathtargetr"rrrrsH      )N)N)__doc____all___impr _frozen_importlibrr _setupr0 __package____file__replace NameErrorr_frozen_importlib_externalr _pack_uint32_unpack_uint32r-rrrr#rr2rrrrrsL           # usr/lib64/python3.8/encodings/__pycache__/__init__.cpython-38.pyc000064400000007501152371115200020417 0ustar00U e5d@sdZddlZddlZddlmZiZdZdgZejZGddde e Z d d Z d d Z ee ejd kr|ddZeedS)a2 Standard "encodings" Package Standard Python encoding modules are stored in this package directory. Codec modules must have names corresponding to normalized encoding names as defined in the normalize_encoding() function below, e.g. 'utf-8' must be implemented by the module 'utf_8.py'. Each codec module must export the following interface: * getregentry() -> codecs.CodecInfo object The getregentry() API must return a CodecInfo object with encoder, decoder, incrementalencoder, incrementaldecoder, streamwriter and streamreader attributes which adhere to the Python Codec Interface Standard. In addition, a module may optionally also define the following APIs which are then used by the package's codec search function: * getaliases() -> sequence of encoding name strings to use as aliases Alias names returned by getaliases() must be normalized encoding names as defined by normalize_encoding(). Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. N)aliasesz --unknown--*c@s eZdZdS)CodecRegistryErrorN)__name__ __module__ __qualname__r r */usr/lib64/python3.8/encodings/__init__.pyr(srcCsft|trt|d}g}d}|D]:}|s4|dkrV|rF|rF|d||d}q d}q d|S)ae Normalize an encoding name. Normalization works as follows: all non-alphanumeric characters except the dot used for Python package names are collapsed and replaced with a single underscore, e.g. ' -;#' becomes '_'. Leading and trailing underscores are removed. Note that encoding names should be ASCII only. asciiF._T) isinstancebytesstrisalnumappendjoin)encodingcharspunctcr r r normalize_encoding+s    rc Csvt|t}|tk r|St|}t|p:t|dd}|dk rN||g}n|g}|D]B}|rXd|krjqXztd|tdd}Wntk rYqXXqqXd}z |j }Wnt k rd}YnX|dkrdt|<dS|}t |t j s(dt|krdksntd|j|jft|drt|d r|d dk rVt|d r|d dk rrt|d rt|dkr|ddk rt|drt|d kr|d dk rt|d std |j|jft|dks|ddkr|ddt||jdd d f7}t j |}|t|<z |}Wnt k rRYn X|D]} | tkrX|t| <qX|S)Nr r z encodings.r)fromlistlevelz#module "%s" (%s) failed to registerrz'incompatible codecs in module "%s" (%s))N)_cacheget_unknownr_aliasesreplace __import__ _import_tail ImportError getregentryAttributeErrorrcodecs CodecInfolenrr__file__callablesplit getaliases) rentry norm_encodingaliased_encodingmodnamesmodnamemodr* codecaliasesaliasr r r search_functionFs                    (    r;Zwin32cCsNz4ddl}d|}||kr2ddl}|jWSWntk rHYnXdS)Nrzcp%s)_winapiZGetACPZencodings.mbcsmbcsr*r))rr<Zansi_code_pageZ encodingsr r r _alias_mbcss r>)__doc__r,sysrrr"r$r(r% LookupError SystemErrorrrr;registerplatformr>r r r r s U   usr/lib64/python3.8/http/__pycache__/__init__.cpython-38.pyc000064400000013662152372003550017437 0ustar00U e5d@s&ddlmZdgZGdddeZdS))IntEnum HTTPStatusc@seZdZdZdAddZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;dZ>d?Z?d@S)BraHTTP status codes and reason phrases Status codes from the following RFCs are all observed: * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616 * RFC 6585: Additional HTTP Status Codes * RFC 3229: Delta encoding in HTTP * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518 * RFC 5842: Binding Extensions to WebDAV * RFC 7238: Permanent Redirect * RFC 2295: Transparent Content Negotiation in HTTP * RFC 2774: An HTTP Extension Framework * RFC 7725: An HTTP Status Code to Report Legal Obstacles * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2) cCs"t||}||_||_||_|S)N)int__new___value_phrase description)clsvaluerr objr %/usr/lib64/python3.8/http/__init__.pyrs  zHTTPStatus.__new__)dZContinuez!Request received, please continue)ezSwitching Protocolsz.Switching to new protocol; obey Upgrade header)fZ Processing)OKz#Request fulfilled, document follows)ZCreatedzDocument created, URL follows)ZAcceptedz/Request accepted, processing continues off-line)zNon-Authoritative InformationzRequest fulfilled from cache)z No Contentz"Request fulfilled, nothing follows)z Reset Contentz"Clear input form for further input)zPartial ContentzPartial content follows)z Multi-Status)zAlready Reported)zIM Used)i,zMultiple Choicesz,Object has several resources -- see URI list)i-zMoved Permanently(Object moved permanently -- see URI list)i.ZFound(Object moved temporarily -- see URI list)i/z See Otherz'Object moved -- see Method and URL list)i0z Not Modifiedz)Document has not changed since given time)i1z Use Proxyz@You must use proxy specified in Location to access this resource)i3zTemporary Redirectr)i4zPermanent Redirectr)iz Bad Requestz(Bad request syntax or unsupported method)iZ Unauthorizedz*No permission -- see authorization schemes)izPayment Requiredz"No payment -- see charging schemes)iZ Forbiddenz0Request forbidden -- authorization will not help)iz Not FoundzNothing matches the given URI)izMethod Not Allowedz-Specified method is invalid for this resource)izNot Acceptablez%URI not available in preferred format)izProxy Authentication Requiredz7You must authenticate with this proxy before proceeding)izRequest Timeoutz"Request timed out; try again later)iZConflictzRequest conflict)iZGonez5URI no longer exists and has been permanently removed)izLength Requiredz"Client must specify Content-Length)izPrecondition Failedz Precondition in headers is false)izRequest Entity Too LargezEntity is too large)izRequest-URI Too LongzURI is too long)izUnsupported Media Typez!Entity body in unsupported format)izRequested Range Not SatisfiablezCannot satisfy request range)izExpectation Failedz'Expect condition could not be satisfied)izMisdirected Requestz(Server is not able to produce a response)izUnprocessable Entity)iZLocked)izFailed Dependency)izUpgrade Required)izPrecondition Requiredz8The origin server requires the request to be conditional)izToo Many RequestszOThe user has sent too many requests in a given amount of time ("rate limiting"))izRequest Header Fields Too LargezVThe server is unwilling to process the request because its header fields are too large)izUnavailable For Legal ReasonszOThe server is denying access to the resource as a consequence of a legal demand)izInternal Server ErrorzServer got itself in trouble)izNot Implementedz&Server does not support this operation)iz Bad Gatewayz+Invalid responses from another server/proxy)izService Unavailablez8The server cannot process the request due to a high load)izGateway Timeoutz4The gateway server did not receive a timely response)izHTTP Version Not SupportedzCannot fulfill request)izVariant Also Negotiates)izInsufficient Storage)iz Loop Detected)iz Not Extended)izNetwork Authentication Requiredz7The client needs to authenticate to gain network accessN)r)@__name__ __module__ __qualname____doc__rZCONTINUEZSWITCHING_PROTOCOLSZ PROCESSINGrZCREATEDZACCEPTEDZNON_AUTHORITATIVE_INFORMATIONZ NO_CONTENTZ RESET_CONTENTZPARTIAL_CONTENTZ MULTI_STATUSZALREADY_REPORTEDZIM_USEDZMULTIPLE_CHOICESZMOVED_PERMANENTLYZFOUNDZ SEE_OTHERZ NOT_MODIFIEDZ USE_PROXYZTEMPORARY_REDIRECTZPERMANENT_REDIRECTZ BAD_REQUESTZ UNAUTHORIZEDZPAYMENT_REQUIREDZ FORBIDDENZ NOT_FOUNDZMETHOD_NOT_ALLOWEDZNOT_ACCEPTABLEZPROXY_AUTHENTICATION_REQUIREDZREQUEST_TIMEOUTZCONFLICTZGONEZLENGTH_REQUIREDZPRECONDITION_FAILEDZREQUEST_ENTITY_TOO_LARGEZREQUEST_URI_TOO_LONGZUNSUPPORTED_MEDIA_TYPEZREQUESTED_RANGE_NOT_SATISFIABLEZEXPECTATION_FAILEDZMISDIRECTED_REQUESTZUNPROCESSABLE_ENTITYZLOCKEDZFAILED_DEPENDENCYZUPGRADE_REQUIREDZPRECONDITION_REQUIREDZTOO_MANY_REQUESTSZREQUEST_HEADER_FIELDS_TOO_LARGEZUNAVAILABLE_FOR_LEGAL_REASONSZINTERNAL_SERVER_ERRORZNOT_IMPLEMENTEDZ BAD_GATEWAYZSERVICE_UNAVAILABLEZGATEWAY_TIMEOUTZHTTP_VERSION_NOT_SUPPORTEDZVARIANT_ALSO_NEGOTIATESZINSUFFICIENT_STORAGEZ LOOP_DETECTEDZ NOT_EXTENDEDZNETWORK_AUTHENTICATION_REQUIREDr r r rrsz N)enumr__all__rr r r rs lib64/python3.8/concurrent/__pycache__/__init__.cpython-38.pyc000064400000000206152372017470020025 0ustar00U e5d&@sdS)Nrrr+/usr/lib64/python3.8/concurrent/__init__.pyusr/lib64/python3.8/xmlrpc/__pycache__/__init__.cpython-38.pyc000064400000000202152373206750017757 0ustar00U e5d&@sdS)Nrrr'/usr/lib64/python3.8/xmlrpc/__init__.pylib64/python3.8/xml/dom/__pycache__/__init__.cpython-38.pyc000064400000012634152373365320017233 0ustar00U e5d@sdZGdddZdZdZdZdZdZdZd Zd Z d Z d Z d Z dZ dZdZdZdZGdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdd d eZGd!d"d"eZGd#d$d$eZGd%d&d&eZGd'd(d(eZGd)d*d*eZGd+d,d,eZGd-d.d.eZ Gd/d0d0eZ!Gd1d2d2eZ"Gd3d4d4eZ#Gd5d6d6Z$d7Z%d8Z&d9Z'd:Z(d:Z)dd;l*m+Z+m,Z,d:S)src@seZdZeZdS) IndexSizeErrN)rrrINDEX_SIZE_ERRr!rrrrr#Lsr#c@seZdZeZdS)DomstringSizeErrN)rrrDOMSTRING_SIZE_ERRr!rrrrr%Osr%c@seZdZeZdS)HierarchyRequestErrN)rrrHIERARCHY_REQUEST_ERRr!rrrrr'Rsr'c@seZdZeZdS)WrongDocumentErrN)rrrWRONG_DOCUMENT_ERRr!rrrrr)Usr)c@seZdZeZdS)InvalidCharacterErrN)rrrINVALID_CHARACTER_ERRr!rrrrr+Xsr+c@seZdZeZdS)NoDataAllowedErrN)rrrNO_DATA_ALLOWED_ERRr!rrrrr-[sr-c@seZdZeZdS)NoModificationAllowedErrN)rrrNO_MODIFICATION_ALLOWED_ERRr!rrrrr/^sr/c@seZdZeZdS) NotFoundErrN)rrr NOT_FOUND_ERRr!rrrrr1asr1c@seZdZeZdS)NotSupportedErrN)rrrNOT_SUPPORTED_ERRr!rrrrr3dsr3c@seZdZeZdS)InuseAttributeErrN)rrrINUSE_ATTRIBUTE_ERRr!rrrrr5gsr5c@seZdZeZdS)InvalidStateErrN)rrrINVALID_STATE_ERRr!rrrrr7jsr7c@seZdZeZdS) SyntaxErrN)rrr SYNTAX_ERRr!rrrrr9msr9c@seZdZeZdS)InvalidModificationErrN)rrrINVALID_MODIFICATION_ERRr!rrrrr;psr;c@seZdZeZdS) NamespaceErrN)rrr NAMESPACE_ERRr!rrrrr=ssr=c@seZdZeZdS)InvalidAccessErrN)rrrINVALID_ACCESS_ERRr!rrrrr?vsr?c@seZdZeZdS) ValidationErrN)rrrVALIDATION_ERRr!rrrrrAysrAc@s eZdZdZdZdZdZdZdS)UserDataHandlerzBClass giving the operation constants for UserDataHandler.handle().rrrrN)rrrrZ NODE_CLONEDZ NODE_IMPORTEDZ NODE_DELETEDZ NODE_RENAMEDrrrrrC|s rCz$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/2000/xmlns/zhttp://www.w3.org/1999/xhtmlN)getDOMImplementationregisterDOMImplementation)-rrr$r&r(r*r,r.r0r2r4r6r8r:r<r>r@rBrrr#r%r'r)r+r-r/r1r3r5r7r9r;r=r?rArCZ XML_NAMESPACEZXMLNS_NAMESPACEZXHTML_NAMESPACEZEMPTY_NAMESPACEZ EMPTY_PREFIXZdomregrDrErrrrsR usr/lib64/python3.8/html/__pycache__/__init__.cpython-38.pyc000064400000007044152373432350017426 0ustar00U e5d~@sdZddlZddlmZddgZdddZdd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*"Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddddddddddddddddddddh~Z ddZ e dZ ddZ dS)z* General functions for HTML manipulation. N)html5escapeunescapeTcCsD|dd}|dd}|dd}|r@|dd}|d d }|S) z Replace special characters "&", "<" and ">" to HTML-safe sequences. If the optional flag quote is true (the default), the quotation mark characters, both double quote (") and single quote (') characters are also translated. &z&z>"z"'z')replace)sZquoter %/usr/lib64/python3.8/html/__init__.pyr s     � u€u‚uƒu„u…u†u‡uˆu‰uŠu‹uŒuŽu‘u’u“u”u•u–u—u˜u™ušu›uœužuŸ)"r rrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiii i i i i i i i i i iiiiicCs|d}|ddkr|ddkrsR  ' lib64/python3.8/sqlite3/__pycache__/__init__.cpython-38.pyc000064400000000242152373472550017234 0ustar00U e5d@s ddlTdS))*N)Zsqlite3.dbapi2rr(/usr/lib64/python3.8/sqlite3/__init__.pyusr/lib64/python3.8/curses/__pycache__/__init__.cpython-38.pyc000064400000004136152373613670017773 0ustar00U e5d@shdZddlTddlZddlZddZddZzeWn e k rTdd lmZYnXd d Z d e _ dS) zcurses The main package for curses support for Python. Normally used by importing the package, and perhaps a particular module inside it. import curses from curses import textpad curses.initscr() ... )*NcCspddl}ddl}ttjddtjd| }|j D],\}}|dddks^|dkr>t |||q>|S)NrZTERMunknown)ZtermfdZACS_)ZLINESZCOLS) _cursescursesZ setupterm_osenvironget_sys __stdout__filenoinitscr__dict__itemssetattr)rrstdscrkeyvaluer'/usr/lib64/python3.8/curses/__init__.pyrsrcCs@ddl}ddl}|}t|dr*|j|_t|dr<|j|_|S)NrCOLORS COLOR_PAIRS)rr start_colorhasattrrr)rrZretvalrrrr*s  r)has_keyc Os|r|^}}ns   2lib64/python3.8/xml/etree/__pycache__/__init__.cpython-38.pyc000064400000000205152374621400017542 0ustar00U e5dD@sdS)Nrrr*/usr/lib64/python3.8/xml/etree/__init__.py