ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- lib64/python3.12/json/__pycache__/__init__.cpython-312.pyc000064400000032461152346432470016754 0ustar00 ֦i6 dZdZgdZdZddlmZmZddlmZddl Z ed d d d ddd Z d d d d ddddd d d Z d d d d ddddd d dZ eddZ dZddddddddZddddddddZy)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.9)dumpdumpsloadloads JSONDecoderJSONDecodeError JSONEncoderzBob Ippolito )rr)rNFT)skipkeys ensure_asciicheck_circular allow_nanindent separatorsdefault) r r r rclsrrr sort_keysc |s(|r&|r$|r"| ||| | s| stj|} n(|t}|d||||||| | d| j|} | D]} |j| y)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 ``RecursionError`` (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 rrrrr)_default_encoder iterencoderwrite)objfpr r r rrrrrrkwiterablechunks &/usr/lib64/python3.12/json/__init__.pyrrxsZ 9 :+= "#..s3 ;C8|)Yv!y85789C 3   c |s'|r%|r#|r!||||| s| stj|S|t}|d|||||||| d| j|S)avSerialize ``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 ``RecursionError`` (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. rr)rencoder) rr r r rrrrrrrs rrrs{X 9 :+= "&&s++ {   %6w)   fSk r ) object_hookobject_pairs_hookcz|j}|tjtjfry|tjtj fry|tj ryt|dk\r"|ds |drdSdS|ds|d s|d rd Sd Sy t|d k(r |dsy|dsy y )Nzutf-32zutf-16z utf-8-sigr r z utf-16-bez utf-32-bez utf-16-lez utf-32-lezutf-8) startswithcodecs BOM_UTF32_BE BOM_UTF32_LE BOM_UTF16_BE BOM_UTF16_LEBOM_UTF8len)b bstartswiths rdetect_encodingr3s,,KF'')<)<=>F'')<)<=>6??# 1v{t#$A$; 7K 7t#$A$!A$; ?K ?  Q1tt r rr# parse_float parse_intparse_constantr$c Dt|jf||||||d|S)aDeserialize ``fp`` (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders. If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. r4)rread)rrr#r5r6r7r$rs rrrs>&  R [9%9J ROQ RRr c t|tr|jdr`td|dt|tt fs"t d|jj|jt|d}|!||||||stj|S|t}|||d<|||d<|||d<|||d <|||d <|d i|j|S) aRDeserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance containing a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). ``object_pairs_hook`` is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of ``object_pairs_hook`` will be used instead of the ``dict``. This feature can be used to implement custom decoders. If ``object_hook`` is also defined, the ``object_pairs_hook`` takes priority. ``parse_float``, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal). ``parse_int``, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` kwarg; otherwise ``JSONDecoder`` is used. uz-Unexpected UTF-8 BOM (decode using utf-8-sig)r z5the JSON object must be str, bytes or bytearray, not surrogatepassr#r$r5r6r7r) isinstancestrr)rbytes bytearray TypeError __class____name__decoder3_default_decoderr)srr#r5r6r7r$rs rrr+s#D!S << !!"Q"#Q( (!eY/0##$;;#7#7"8:; ; HH_Q' 9 +  +"5  "'8'@&&q)) {'=$"3 '=#;!-  99  A r )__doc__ __version____all__ __author__decoderrrencoderrr*rrrrDr3rrrr rrLs`B   - 1    $$tD$<~!tDD$7t44H<dttR2dtt<r lib64/python3.12/zipfile/__pycache__/__init__.cpython-312.pyc000064400000304333152347354020017440 0ustar00 ֦i[dZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z e jZ ddlZ ddlZgdZGddeZGddeZexZZdZd Zd ZdZd Zd Zd Zd ZdZdZ dZ!dZ"dZ#dZ$ejJe#Z&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.d Z/dZ0dZ1dZ2ejJe1Z3dZ4dZ5dZ6dZ7dZ8dZ9dZ:dZ;d ZdZ?d Z@dZAd ZBd ZCd!ZDd"ZEd#ZFdZGdZHd ZId$ZJd%ZKd&ZLd'ZMd(ZNejJeMZOdZPdZQdZRdZSdZTdZUdZVdZWd ZXdZYdZZdZ[d)Z\d*Z]ejJe\Z^d+Z_d,Z`ejJe_ZadZbdZcdZddZedZfdZgdZhdZid ZjdZkd-Zlejd.Znd/Zod0Zpd1Zqd2Zrd3Zsd4ZtGd5d6euZvdawd7Zxd8ZyGd9d:ZzGd;d<Z{idd=dd>dd?dd?dd?dd?dd@ddAd dBddCdd@d dDd dEd#dFdGdHdIdJdKdLZ|dMZ}d^dNZ~dOZGdPdQZGdRdSZGdTdUejZGdVdWejZGdXdYZGdZd[eZd^d\Zdd]lmZmZy#e$rdZ ejZ Y$wxYw#e$rdZY-wxYw#e$rdZY6wxYw)_zP Read and write ZIP files. XXX references to utf-8 need further investigation. N) BadZipFile BadZipfileerror ZIP_STORED ZIP_DEFLATED ZIP_BZIP2ZIP_LZMA is_zipfileZipInfoZipFile PyZipFile LargeZipFilePathc eZdZy)rN)__name__ __module__ __qualname__)/usr/lib64/python3.12/zipfile/__init__.pyrr'srrceZdZdZy)rzu Raised when writing a zipfile, the zipfile requires ZIP64 extensions and those extensions are disabled. N)rrr__doc__rrrrr+srri -.?s<4s4H2LHsPK z<4s4B4HL2L5H2LsPK  @iz <4s2B4HL2L2HsPKz<4sLQLsPKz <4sQ2H2L4QsPKiPK t|ry y#t$rYywxYw)NTF) _EndRecDataOSErrorfps r_check_zipfilerHs2 r?      s  cd} t|drt|}|St|d5}t|}ddd|S#1swY|SxYw#ttf$rY|SwxYw)zQuickly see if a file is a ZIP file by checking the magic number. The filename argument may be a file or file-like object too. FreadrFrbN)hasattrrHopenrEr)filenameresultrGs rr r sw F 8V $#x0F M h%'+& M & M Z   M s2A A AA A A A A A c |tz}|dkr|S|j||jt}t|tk7r t dt j t|\}}}}|tk7r|S|dk7s|dkDr td|tz}||kDr td|j|||z }|jt}t|tk7r t d|jtsJ||k7rE|j|d}|jt}t|tk7r t d|jts tdt j t|\ }} } } } } }}}}||z|k7s| dzt|zk7r td||t<| |t<| |t <||t"<||t$<||t&<||t(<||z |t*<|S) zM Read the ZIP64 end-of-archive records and use that to update endrec rzUnknown I/O errorr!z3zipfiles that span multiple disks are not supportedz.Corrupt zip64 end of central directory locatorz/Zip64 end of central directory record not foundrz-Corrupt zip64 end of central directory record)sizeEndCentDir64LocatorseekrJr6rEstructr5structEndArchive64LocatorstringEndArchive64LocatorrsizeEndCentDir64 startswithstringEndArchive64structEndArchive64_ECD_SIGNATURE_ECD_DISK_NUMBER_ECD_DISK_START_ECD_ENTRIES_THIS_DISK_ECD_ENTRIES_TOTAL _ECD_SIZE _ECD_OFFSET _ECD_LOCATION)fpinoffsetendrecdatasigdisknoreloffdisksextraszszcreate_version read_versiondisk_numdisk_dirdircount dircount2dirsize diroffsets r _EndRecData64rts  %%F z IIf 99, -D 4y++)**!'/H$!OC ''  {eaiNOO F IJJIIfvoG 99% &D 4y$$)** ??- .6V3C &yy)* t9( (-. . ??- .JKK  ($/0C^\8X)WiGv% R#g--HII!F>'F &F?%-F !"!*F F9#F;"W,F= Mrc|jdd|j} |jt d|j t}t |tk(rv|ddt k(rj|dddk(rbtjt|}t|}|jd|j|tz t||tz |St|tz tz d}|j|d|j ttz}|jt }|dk\r|||tz}t |tk7ryttjt|}|t }||tz|tz|z}|j||j||zt|||z|Sy#t$rYywxYw)zReturn data from the "End of Central Directory" record, or None. The data is a list of the nine items in the ZIP "End of central dir" record followed by a tenth item, the file seek offset of this record.rr"Nr$sr)rRtellsizeEndCentDirrErJr6stringEndArchiverSr5structEndArchivelistr7rtmaxZIP_MAX_COMMENTrfind_ECD_COMMENT_SIZE) rbfilesizererdmaxCommentStartr=recData commentSizecomments rrDrD*s IIaOyy{H  >/1% 99^ $D D ^# Qq %% RS [ /6F|  c h/0T8n#12 w<> )fmm$4g>?./ u^+E.,@,LM g o-.T?U#:FCC U sG GGc|jtd}|dk\r|d|}tjdk7r2tj|vr |j tjd}tj rEtj dk7r2tj |vr |j tj d}|S)zzTerminate the file name at the first null byte and ensure paths always use forward slashes as the directory separator.r/)findchrossepreplacealtsep)rN null_bytes r_sanitize_filenameres  c!f%IA~Ai( vv}8+##BFFC0 yyRYY#%"))x*?##BIIs3 OrcTeZdZdZdZd dZdZddZdZdZ e dd d d Z d Z y)r z>Class with attributes describing each file in the ZIP archive.) orig_filenamerN date_time compress_type_compresslevelrr9 create_systemrlextract_versionreserved flag_bitsvolume internal_attr external_attr header_offsetCRC compress_size file_size _raw_time _end_offsetc||_t|}||_||_|ddkr t dt |_d|_d|_d|_ tjdk(rd|_ nd|_ t|_t|_d|_d|_d|_d|_d|_d|_d|_d|_y)Nrz+ZIP does not support timestamps before 1980rwin32r#)rrrNr ValueErrorrrrrr9sysplatformrDEFAULT_VERSIONrlrrrrrrrrr)selfrNrs r__init__zZipInfo.__init__s%&h/  " Q<$ JK K("  <<7 "!"D "#D -.  rcd|jjd|jg}|jtk7r<|j dt j|j|jz|jdz }|jdz}|r'|j dtj|z|r|j d|z|j}|r |jr|j d|jz|r |jrJ|jtk7s|j|jk7r|j d |jz|j d d j|S) N) __class__rrNrrr7compressor_namesgetrstatfilemodeis_dirrrr8)rrOhiloisdirs r__repr__zZipInfo.__repr__s;'+~~'>'> NO    + MM-*..t/A/A/3/A/ACC D  2 %   & ( MM.4==+<< = MM.3 4  MM/DNN: ;$,,   : - ^^t11 1 MM-0B0BB C cwwvrNc|j}|ddz dz|ddzz|dz}|ddz|d dzz|ddzz}|jtzrdx}x}}n$|j}|j}|j }|j }d} ||tkDxs |tkD}|r>d } |tj| dtj| d z ||z}d }d }t} |jtk(rtt| } n#|jt k(rtt"| } t| |j$|_t| |j&|_|j)\} } tjt*t,|j$|j.| |j|||||t1| t1| } | | z|zS) zReturn the per-file header as a bytes object. When the optional zip64 arg is None rather than a bool, we will decide based upon the file_size and compress_size, if known, False otherwise. rrr(r!r%r"r#r*r$z>5 5./ /C /-)((C ..MI  = +J}{/JE CFKK()6??3+?+A9m]]E"I&M'K    *m[9K   8 +lK8K";0D0DE!+t/B/BC"779)-/?!114==)!//'3*I ]CJ 8  5((rc |jjd|jfS#t$r1|jjd|jtzfcYSwxYw)Nasciiutf-8)rNencoderUnicodeEncodeError_MASK_UTF_FILENAMErs rrzZipInfo._encodeFilenameFlagss[ V==''0$..@ @! V==''0$..CU2UU U Vs&)7A#"A#c|j}tj}t|dk\r2|d|dd\}}|dzt|kDrt d||fz|dk(r|d|dz} |j dvrd}|d|dd\|_|dd}|j d k(rd }|d|dd\|_|dd}|jd k(rd }|d|dd\|_ne|dk(r`|d|dz} |d|dd\}} |dk(rC| |k(r>|ddjd} | rt| |_ nddl } | jdd||dzd}t|dk\r1yy#tj$rt d d dwxYw#tj$r} t d| d} ~ wt$r} t d| d} ~ wwxYw)Nr$r2z"Corrupt extra field %04x (size=%d)r!)lrz File sizezCorrupt unicode path extra field (0x7075): invalid utf-8 bytes)r9rSr5r6rrrrrdecoderrNwarningswarnUnicodeDecodeError) r filename_crcr9r5tplnrefield up_version up_name_crcup_unicode_nameres r _decodeExtrazZipInfo._decodeExtras %jAoE5!9-FB!tc%j  !ER!PQQV|Qr!t}F~~)MM +*0tBQx*@#ABx))[8 /.4T48.D+*#ABx))[8 /.4T48.D+*vQr!t} n.4UD!H.E+J !Q;,+F*.qr(//'*B*,>,ODM+$MM*S`aMb "Q$%LEO%jAo&||F$'B(-wk&;q#ABajRVVRYY//abkGajRVVRYY//  sNGGY'!zzF2r9 EO   4 '  !jjEO rc |jjdrytjjrM|jjtjj tjjfSy)z2Return True if this archive member is a directory.rTF)rNendswithrrrrrs rrzZipInfo.is_dirWsQ == ! !# & 77>>==))277;;*GH Hr)NoNamerN) rrrr __slots__rrrrr classmethodrrrrrr r xsJHI0  J,.)`V +!Z#D##J rr cLtdD]}|dzr |dz dz }|dz}|S)Nrr!l q[)range)crcrAs r_gen_crcris5 1X 7!8z)C AIC  Jrcdddt"tttt datfdfd|D] }| fd}|S)NixV4igE#ixV4c&|dz ||z dzz S)z(Compute the CRC32 primitive on one byte.rr)chrcrctables rcrc32z_ZipDecrypter..crc32s qHcBh$%6777rc\|dzzdzdzdzdzdz y)Nr rir!r)crkey0key1key2s r update_keysz"_ZipDecrypter..update_keyssEQ~t $ 2y 1$ 2TRZ&rct}|j}|D](}dz}|||dz zdz dzz}|||*t|S)zDecrypt a bytes object.r"r!rr ) bytearrayr7bytes)rerOr7rkrrs r decrypterz _ZipDecrypter..decrypters\AqA 1!9"d* *A N 1I  V}r) _crctabler{maprr) pwdprrr rrrrs @@@@@@r _ZipDecrypterrys^ D D DXuSz23 H8'A  rc$eZdZdZdZdZdZy)LZMACompressorcd|_yr)_comprs rrzLZMACompressor.__init__s  rc.tjdtji}tjtjtj tj|g|_tjdddt||zS)Nidfiltersz?FE4##$E 100..t/@/@/3/?/?!e)/LNKDL##AIJ/D ((.<<## rN)rrrrr;rrrr5r5s  rr5storeshrinkreduceimplodetokenizedeflate deflate64bzip2r(terselz77awavpackbppmdc|tk(ry|tk(rts tdy|tk(rt s tdy|t k(rts tdytd)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported) rrzlib RuntimeErrorrbz2r r(NotImplementedError) compressions r_check_compressionrRsj   $@B B  !?A A  @B B""LMMrcX|tk(rZ|%tj|tjdStjtjtjdS|t k(r+|t j|St jS|tk(r tSy)N) rrM compressobjDEFLATEDZ_DEFAULT_COMPRESSIONrrO BZ2Compressorr r!)r compresslevels r_get_compressorrZs $  $##M4==#F F : :DMM3OO ) #  $$$]3 3  "" ( "rc4t||tk(ry|tk(rtjdS|t k(rt jS|tk(r tStj|}|rtd||fztd|fz)NrTzcompression type %d (%s)zcompression type %d) rRrrrM decompressobjrrOBZ2Decompressorr r5rrrP)rdescrs r_get_decompressorr_ s}% " , &!!#&& ) #""$$ ( "!! $$]3 %&@MSXCY&YZ Z%&;}>N&NO Orc.eZdZdZdZddZddZdZy) _SharedFilecl||_||_||_||_||_|j |_yr)_file_pos_close_lock_writingseekable)rfileposcloselockwritings rrz_SharedFile.__init__s0       rc|jSr)rdrs rrwz_SharedFile.tell$s yyrc|j5|jr td|tjk(r)|j j |j|zn|j j |||j j|_|jcdddS#1swYyxYw)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.) rfrgrrSEEK_CURrcrRrdrw)rrcwhences rrRz_SharedFile.seek's ZZ}} "JKK$  F 23 / )DI99ZZs BB55B>c>|j5|jr td|jj |j |jj |}|jj|_|cdddS#1swYyxYw)NyCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rfrgrrcrRrdrJrwrnres rrJz_SharedFile.read4sn ZZ}} "JKK JJOODII &::??1%D )DIZZs A$rY{wxYw) NFrrrTrr rzBad password for file %r)'_fileobj_pwd_close_fileobjr_compress_typer_compress_leftr_leftr_ _decompressor_eof _readbuffer_offsetnewlinesmoderNnamerLr _expected_crcr _running_crc _seekablerhrw_orig_compress_start_orig_compress_size_orig_file_size_orig_start_crc _orig_crcAttributeError _decrypterrrr_init_decrypterrNr)rrwrzipinfor close_fileobj check_bytehs rrzZipExtFile.__init__hs  +%33%33&& .t/B/BC    $$ 7E "!(D  %c D !%D  !,3LLN)+2+@+@('.'8'8$'+'8'8$!%!3!3!%   #<<%//14< &kkR/47 $$&AJ"#=@U@U#UVV     sA0F44 G?Gct|j|_|jj d}|xj dzc_|j|dS)Nrr*)rrrrrJr)rrs rrzZipExtFile._init_decryptersM' 2 ##B' r!v&r**rcd|jjd|jjg}|js{|j d|j d|j |jtk7rN|j dtj|j|jzn|j d|j ddj|S) Nr.z name=z mode=r [closed]rr) rrrclosedr7rrrrrrr8rrOs rrzZipExtFile.__repr__s"nn77"nn99;<{{ MM 499E F""j0 1.2243F3F373F3FHHI MM+ & cwwvrc|dkrP|jjd|jdz}|dkDr"|j|j|}||_|Stjj ||S)zrRead and return a line from the stream. If limit is specified, at most limit bytes will be read. r r!)rrrioBufferedIOBasereadline)rlimitr>lines rrzZipExtFile.readlinesn 19  %%eT\\:Q>A1u'' a8     ))$66rcx|t|j|jz kDrp|j|}t||jkDr)||j|jdz|_d|_n|xjt|zc_|j|j|jdzS)z6Returns buffered bytes without advancing the position.Nri)r6rrrJ)rruchunks rpeekzZipExtFile.peeks s4##$t||3 3IIaLE5zDLL(#(4+;+;DLLM+J#J    E *  dllS.@AArc2|jr tdy)NI/O operation on closed file.T)rrrs rreadablezZipExtFile.readables ;;<= =rc|jr td||dkr`|j|jd}d|_d|_|js+||j |j z }|js+|S||jz}|t|jkr"|j|j|}||_|S|t|jz }|j|jd}d|_d|_|dkDri|js]|j |}|t|kr||_||_||d|z } |S||z }|t|z}|dkDr |js]|S)zRead and return up to n bytes. If the argument is omitted, None, or negative, data is read and returned until EOF is reached. zread from closed file.Nrr)rrrrr_read1MAX_Nr6)rrubufendres rrJzZipExtFile.readsk ;;56 6 9A""4<<=1C"D DLiit{{4::..iiJ$,, T%%& &""4<<4CDLJ #d&&' 't||}- !eDII;;q>D3t9}#'   tBQx  4KC TNA!eDII rc|jyt||j|_|jr2|j|jk7rt d|j zyy)NzBad CRC-32 for file %r)rrrrrr)rnewdatas r _update_crczZipExtFile._update_crcs]    % !'4+<+<= 99**d.@.@@5 AB BA9rc||dkrg|j|jd}d|_d|_|js2|j|j}|r||z } |S|js2|S||jz}|t |jkr"|j|j|}||_|S|t |jz }|j|jd}d|_d|_|dkDr[|jsO|j|}|t |kr||_||_||d|z } |S|r||z } |S|jsO|S)z7Read up to n bytes with at most one read() system call.Nrr)rrrrrr6)rrurrers rread1zZipExtFile.read1sb 9A""4<<=1C"D DLii{{4::.4KCJ ii J$,, T%%& &""4<<4CDLJ #d&&' 't||}- q5ii{{1~s4y='+D$#$DL48OC 4KC ii rc|js|dkry|jtk(rE|jj}|t |kDr2||j |t |z z }n|j |}|jtk(r|jdk|_n|jtk(rt||j}|jj||}|jjxs(|jdkxr|jj |_|jre||jjz }nG|jj|}|jjxs|jdk|_|d|j}|xjt |zc_|jdkrd|_|j||S)NrrT)rrrrunconsumed_tailr6_read2rrr| MIN_READ_SIZEr;r9r3rrrts rrzZipExtFile._read1)s 99Q   , .%%55D3t9} AD M22;;q>D   * ,++q0DI  L 0At))*A%%00q9D++//@,,1@!//??? Iyy**0022%%006D**..J$2E2E2JDIKTZZ  c$i ::?DI  rc:|jdkryt||j}t||j}|jj |}|xjt |zc_|st|j|j|}|S)Nrr) rr|rminrrJr6EOFErrorrrts rrzZipExtFile._read2Ms   ! # 4%% & 4&& '}}!!!$ s4y(N ?? &??4(D rc |jr|jjt| y#t| wxYwr)rrrksuper)rrs rrkzZipExtFile.close]s4 "" ##% GMOEGMOs &8AcH|jr td|jSNr)rrrrs rrhzZipExtFile.seekableds ;;<= =~~rc|jr td|jstjd|j }|t jk(r|}nG|t jk(r||z}n.|t jk(r|j|z}n td||jkDr |j}|dkrd}||z }||jz}|dk\r#|t|jkr ||_ d}n|jtk(r|j |dk7rd|_|t|j|jz z}|j$j'|t j|xj(|zc_|xj*|zc_|j(dk|_d}d|_ d|_ n|dkr|j$j'|j.|j0|_|j4|_|j6|_|j|_d|_ d|_ t9|j|_d|_|}|j |j=|dkDr2t?|j@|}|jC|||z}|dkDr2|j S)Nzseek on closed file.!underlying stream is not seekablezCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)rrF)"rrrrUnsupportedOperationrwrSEEK_SETrpSEEK_ENDrrr6rrrrrrrRrrrrrrrrr_rrr MAX_SEEK_READrJ)rrcrqcurr_posnew_pos read_offset buff_offsetread_lens rrRzZipExtFile.seekiss ;;34 4~~))*MN N99; R[[ G r{{ "'G r{{ "**V3GCD D T)) )**G Q;G( !DLL0 !  c$2B2B.C C&DLK  J .4??3J{^_O_!%D  3t//04<<? ?K MM  {BKK 8 JJ+ %J   ; .  aDIK"D DL 1_ MM  t88 9 $ 4 4D !%D "&":":D --DJ"D DL!243F3F!GD DI!K*$$&Ao4--{;H IIh  8 #KAo yy{rc|jr td|jstjd|j |j z t|jz |jz}|S)Nztell on closed file.r) rrrrrrrr6rr)rfileposs rrwzZipExtFile.tells` ;;34 4~~))*MN N&&3c$:J:J6KKdllZr)NFrxr!)rrrrrrrrrrrrrrJrrrrrkrhrrrRrw __classcell__rs@rrrZs EMM37$1Wh + 7 B !FC#J"H  #%++?Brrc@eZdZdZedZdZdZfdZxZ S) _ZipWriteFilec||_||_||_t|j|j |_d|_d|_d|_ yr}) _zinfo_zip64_zipfilerZrr _compressor _file_size_compress_size_crc)rzfrrs rrz_ZipWriteFile.__init__sL   *5+>+>+0+?+?A rc.|jjSr)rrGrs rrz_ZipWriteFile._fileobjs}}rcy)NTrrs rwritablez_ZipWriteFile.writablesrc|jr tdt|ttfr t |}nt |}|j}|xj|z c_t||j|_ |jr9|jj|}|xjt |z c_ |jj||Sr)rrrrrr6 memoryviewnbytesrrrrr0rrr)rrers rrz_ZipWriteFile.writes ;;<= = dUI. /YFd#D[[F 6!$ *   ##,,T2D   3t9 ,  D! rc |jry t| |jro|jj }|xj t |z c_|jj||j |j_ n|j|j_ |j|j_ |j|j_|js<|jt kDr t#d|j t kDr t#d|jj$t&zr|jrdnd}|jjt)j*|t,|jj|jj|jj|jj/|j0_n|jj/|j0_|jj5|jj6|jj|jj9|j|jj5|j0j2|j0j:j=|j|j|j0j>|jj@<d|j0_!y#d|j0_!wxYw)Nz*File size too large, try using force_zip64z0Compressed size too large, try using force_zip64z ' +/--*<*<*> ' ""4;;#<#<= ##DKK$:$:4;;$GH ""4==#:#:; MM " " ) )$++ 6=A[[DMM $ $T[[%9%9 :%*DMM "UDMM "s LL88M ) rrrrpropertyrrrrkrrs@rrrs0  &++++rrc"eZdZdZdZdZdeddfddddZdZdZ d Z d Z d Z d Z d$d ZdZdZdZedZej(dZd$dZd%dddZd&dZd'dZd(dZedZdZdZ d(dZ d'dZd)dZ d Z!d!Z"d"Z#d#Z$y)*r ai Class with methods to open, read, write, close, list zip files. z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True, compresslevel=None) file: Either the path to the file, or a file-like object. If it is a path, the file will be opened and closed by ZipFile. mode: The mode can be either read 'r', write 'w', exclusive create 'x', or append 'a'. compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib), ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma). allowZip64: if True ZipFile will create files with ZIP64 extensions when needed, otherwise it will raise an exception when this would be necessary. compresslevel: None (default for the given compression type) or an integer specifying the level to pass to the compressor. When using ZIP_STORED or ZIP_LZMA this keyword has no effect. When using ZIP_DEFLATED integers 0 through 9 are accepted. When using ZIP_BZIP2 integers 1 through 9 are accepted. NrT)rmetadata_encodingc|dvr tdt|||_d|_d|_i|_g|_||_||_||_ d|_ d|_ ||_ ||_ |jr|dk7r tdt|tj rtj"|}t|t$r;d|_||_d d d d d d dd}||} t+j,|| |_n d|_||_t3|dd|_d|_t7j8|_d|_d|_ |dk(r|jAy|dvrNd|_ |j.jC|_" |j.jG|jDy|dk(r7 |jA|j.jG|jDytd#t0$r| |vr|| } Y1wxYw#tHt0f$r d|_YywxYw#tHt0f$r+tK|j.|_d|_"d|_YywxYw#tL$rE|j.jGddd|_|j.jC|_"YywxYw#|j.} d|_|jO| xYw)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x', or append 'a'.)rwxaz+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNrrz5metadata_encoding is only supported for reading filesrKw+bx+br+bwbxb)rrrrrrrTr!r)rrrr"z"Mode must be 'r', 'w', 'x', or 'a')(rrR _allowZip64 _didModifydebugrrrQrYrr_comment_strict_timestampsrrrrrstr _filePassedrNrrMrGrEgetattr _fileRefCnt threadingRLockrfrrg_RealGetContentsrwrrRrr{r_fpclose) rrirrQ allowZip64rYrrmodeDictrrGs rrzZipFile.__init__!s + +JK K;'%  &*  "3!2  ! !dckGI I dBKK (99T?D dC  D  DM"U%$T$@H~H ggdH5DG  D DG#D&$7DM__&  ' s{%%'##' /%)WW\\^DN/ T^^4 4))+GGLL0!!EFFc8+#+H#5  @+G4/)./'0+'0DG%&DN%*DN+ "4GGLLA&'+DO%)WW\\^DN4 BDG MM"  s)HK* K6H9%H<K5I68 KHHH63K5H66K97I30K2I33K6A KKKK'K.c|Srrrs r __enter__zZipFile.__enter__s rc$|jyrrk)rtypevalue tracebacks r__exit__zZipFile.__exit__s  rcd|jjd|jjg}|jt|jr|j d|jzn*|j |j d|j z|j d|jzn|j d|j ddj|S) Nrrz file=%rz filename=%rz mode=%rrrr) rrrrGrr7rNrr8rs rrzZipFile.__repr__s"nn77"nn99;< 77  j47723* nt}}<= MM*tyy0 1 MM+ & cwwvrc |j} t|}|s td|jdkDr t ||t }|t}|t|_ |t|z |z }|jdkDr||z}t d|||||z|_ |jdkr td|j|jd|j|}tj|}d}||kr|jt } t#| t k7r tdt%j&t(| } | t*t,k7r td|jdkDr t | |j| t.} t1| } | t2} | t4zr| j7d } n| j7|j8xsd } t;| } |j| t<| _|j| t@| _!| tD| _#| dd \ | _$| _%| _&| _'| _(| _)}}| _*| _+| _,| jLtZkDrt]d | jLd z z| dd\| _/| _0| _1|| _2|dz dz|dz dz|dz|dz |dz dz|dzdzf| _3| ji| | jF|z| _#|jjjm| | |jn| jp<|t z| t.z| t<z| t@z}|jdkDr t d|||kr|j}tstu|jjdD]}||_;|jF}y#t$r tdwxYw)z/Read in the table of contents for the ZIP file.zFile is not a zip filer!r"zgiven, inferred, offsetrz Bad offset for central directoryzTruncated central directoryz&Bad magic number for central directoryrcp437rzzip file version %.1fr)r,r/r(rr%rr*r totalc|jSr)r)rs rz*ZipFile._RealGetContents..s u7J7Jr)keyN) &M#;' |,  &09< ::> )H +Y& I"V+ >>A ?@ @ "www ZZ goggn-G7|~- !>??mm$4g>G}%)99 !IJJzzA~gwww':;AG(: ;AO5zr t=d|t@tBzr|jEd} n|jEjFxsd} | |jHk7rt'd|jHd|d|jJ|jM|jNz|jJkDrz|jJ|jk(rHddl(} | jSd|jHdtTjVjYtZfnt'd|jHd|j8t\z} | rQ|s j^}|r1t|t`s!tcdte|jfz|stid|zd}tk||||dS#|jmxYw)auReturn file-like object for 'name'. name is a string for the file name within the ZIP file, or a ZipInfo object. mode should be 'r' to read a file already in the ZIP file, or 'w' to write to a file newly added to the archive. pwd is the password to decrypt files (only used for reading). When writing, if the file size is not known in advance but may exceed 2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large files. If the size is known in advance, it is best to pass a ZipInfo instance for name, with zinfo.file_size set. >rrzopen() requires mode "r" or "w"rz'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedrOrsr!cjSr)rgrsrrzZipFile.open..bs $--rzTruncated file headerz Bad magic number for file header)rqz$compressed patched data (flag bit 5)zstrong encryption (flag bit 6)rrzFile name in directory z and header z differ.NrzOverlapped entries: z (possible zip bomb))skip_file_prefixesrIz6File %r is encrypted, password required for extractionT)7rrGrr rQrrYrrG_open_to_writergrrarr rfrJsizeFileHeaderr6rrSr5r _FH_SIGNATUREr_FH_FILENAME_LENGTH_FH_EXTRA_FIELD_LENGTHrRr_MASK_COMPRESSED_PATCHrP_MASK_STRONG_ENCRYPTION_FH_GENERAL_PURPOSE_FLAG_BITSrrrrrrwrrrrrdirname__file___MASK_ENCRYPTEDrrrJrrrNrrk) rrrrrPrzef_filefheaderfname fname_strr is_encrypteds ` rrMz ZipFile.open3sd z !>? ? DCKFG GwwDF F dG $E S[DME"&"2"2E #'#5#5E LL&E 3;&&u+&F F ==FG G Atww(;(;#}}djj:OQ= mmN3G7|~- !899mm$4g>G}%)99 !CDDMM'*=">?E-. g&<=a H!77)*PQQ!88)*JKK458JJ!LL1 !LL)?)?)J7K E/// **E344!!- %"5"558I8II$$(;(;;#MM.u/B/B.EF./,.GGOOH,E+G"I %.u/B/B.EF./00 !??_> GGLL ("gglln   e&&u-. T5%00rc|tj}ntj|}|j|||S)alExtract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a ZipInfo object. You can specify a different directory using `path'. You can specify the password to decrypt the file using 'pwd'. )rgetcwdr_extract_member)rmemberrrs rextractzZipFile.extracts6 <99;D99T?D##FD#66rc||j}|tj}ntj|}|D]}|j |||y)a?Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). You can specify the password to decrypt all files using 'pwd'. N)r7rrirrj)rrmembersrrs r extractallzZipFile.extractallsM ?mmoG <99;D99T?DG  $ 4rc|j}|s+d}tj|dt|z}||_|j |}d|j |D}|j d|D}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*_c3>K|]}|jdyw)z .N)rstrip.0rs r z1ZipFile._sanitize_windows_name..sB+Aa188D>+Asc3&K|] }|s| ywrrrts rrvz1ZipFile._sanitize_windows_name..s7'QQq's)!_windows_illegal_name_trans_tabler maketransr6 translatesplitr8)rrpathseptableillegals r_sanitize_windows_namezZipFile._sanitize_windows_namest55GMM'3W+=>E49C 1##E*B7==+AB,,7'77rct|ts|j|}|jj dt j j}t j jrB|j t j jt j j}t j j|d}dt j jt j jft j jjfd|jt j jD}t j jdk(r*|j|t j j}|s|js t!dt j j||}t j j#|}t j j%|}|r4t j j'|st j(||jr6t j j+|st j,||S|j/||5}t/|d5}t1j2||d d d d d d |S#1swYxYw#1swY|SxYw) zbExtract the ZipInfo object 'member' to a physical file on the path targetpath. rr!rc3*K|] }|vr| ywrr)rurinvalid_path_partss rrvz*ZipFile._extract_member.. s##C.H&'/A&A$%.Hs\zEmpty filename.)rrN)rr rGrNrrrrrrcurdirpardirr8r{rrrrr\existsmakedirsrmkdirrMshutil copyfileobj) rrk targetpathrr upperdirssourcetargetrs @rrjzZipFile._extract_members&'*\\&)F//))#rww{{; 77>>oobggnnbggkkBG''$$W-a0 "''.."''..A''++""#CgmmBGGKK.H#CC 77;;$ 11'277;;GGv}}./ /WW\\*g6 WW%%j1 GGOOJ/ RWW^^I6 KK " ==?77==,$  YYv3Y '6 *d #v   vv .$($ #(s$4 K6K*K6*K3 /K66Lc|j|jvr$ddl}|jd|jzd|jdvr t d|j s t dt|j|js]d}t|jtk\rd }n+|jtkDrd }n|jtkDrd }|rt!|d zyy) z6Check for errors before writing a file to the archive.rNzDuplicate name: %rr#rrrrz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed Files countFilesizez Zipfile size would require ZIP64 extensions)rNrrrrrrGrRrrr6rZIP_FILECOUNT_LIMITrrrr)rrrrequires_zip64s rrgzZipFile._writecheck(s >>T__ ,  MM.?AM N 99O +EF FwwFH H5../!N4==!%88!.;.!+$${2!/">#D$EFF rc.|js td|jr tdtj |||j }|j r d|_d|_|j|y|||_ n|j|_ |||_ n|j|_ t|d5}|j|d5}tj ||dddddddy#1swYxYw#1swYyxYw) zLPut the bytes from filename into the archive under the name arcname.7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsrrNrKri )rGrrgr rrrrrrrrQrrYrMrr)rrNrrrYrsrcdests rrz ZipFile.write?swwIK K ==P !!(G484K4K"M <<>"#E EI JJu (&3#&*&6&6#('4$'+'9'9$h%diis.Ct""3f5/D%%.C.C%%s$D C?.D ?D D  Dct|tr|jd}t|tst|t j t jdd}|j |_|j|_ |jjdrd|_ |xjdzc_ n d|_ n|}|js td |jr td |||_|||_ t!||_|j$5|j'|d 5}|j)|ddddddy#1swYxYw#1swYyxYw) aWrite a file into the archive. The contents is 'data', which may be either a 'str' or a 'bytes' instance; if it is a 'str', it is encoded as UTF-8 first. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.rNr&)rNrriAr-rerz?Can't write to ZIP archive while an open writing handle exists.r)r)rrrr rrrQrrYrrNrrrGrrgr6rrfrMr)rzinfo_or_arcnamererrYrrs rwritestrzZipFile.writestr`s; dC ;;w'D*G4%5&*nnTYY[&A"1&EGE"&"2"2E #'#5#5E ~~&&s+&3###t+#&1#$EwwIK K ==Q   $"/E   $#0E d) ZZ5s+t 4 ,Z++Zs$'E*;E E*E' #E**E3ct|tr|}|jstdt|tr^|}|j ds|dz }t|}d|_d|_d|zdzdz|_d|_ |xjdzc_n td|j5|jr%|jj|j|jj!|_|j$t&k(r|xj(t*zc_|j-|d|_|j0j3|||j4|j6<|jj9|j;d |jj!|_d d d y #1swYy xYw) z+Creates a directory inside the zip archive.z/The given ZipInfo does not describe a directoryrri@rr-zExpected type str or ZipInfoTFN)rr rrrrrrrrrJrfrrGrRrrwrrr rrfrgrrr7rrNrr)rzinfo_or_directory_namerrdirectory_names rrz ZipFile.mkdirsb -w 7+E<<> !RSS / 54N!**3/#%N+E"#E EI$+dNf#<"CE EO   4 ' :; ; ZZ~~ T^^,"&'',,.E ""h.#::   U #"DO MM  '.3DOOENN + GGMM%**51 2!WW\\^DNZZs 3DGGc$|jy)z2Call the "close()" method in case the user forgot.Nrrs r__del__zZipFile.__del__s  rc|jy|jr td |jdvrb|jrV|j 5|j r%|jj|j|jddd|j}d|_|j|y#1swY.xYw#|j}d|_|j|wxYw)zOClose the file, and for mode 'w', 'x' and 'a' write the ending records.NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r) rGrgrrrrfrrRr_write_end_recordr r~s rrkz ZipFile.closes 77?  ==PQ Q yyO+ZZ~~ T^^4**, BDG MM"  Z BDG MM" s$&C AB;C;CC&C-c |jD]}|j}|ddz dz|ddzz|dz}|ddz|d dzz|ddzz}g}|jtkDs|jtkDr;|j |j|j |jd }d }n|j}|j}|j tkDr|j |j d }n |j }|j} d} |rHt| d } tjd d t|zzddt|zg|| z} t} |jtk(rtt | } n#|jt"k(rtt$| } t| |j&} t| |j(} |j+\} }tjt,t.| |j0| |j2||j|||j4||t| t| t|j6d|j8|j:|}|j<j?||j<j?| |j<j?| |j<j?|j6|j<jA}t|j}||jBz }|jB}d}|tDkDrd}n|tkDrd}n |tkDrd}|r|jFstI|dztjtJtLtNdz dddd|||| }|j<j?|tjtPtRd|d}|j<j?|tU|d}tU|d }tU|d }tjtVtXdd||||t|jZ }|j<j?||j<j?|jZ|j\dk(r|j<j_|j<jay)Nrrr(r!r%r"r#r*r$rrr2QrrzCentral directory offsetzCentral directory sizerrrrr)1rrrrrr7rr9rBrSrr6rrrr|rr rrrlrr!r#rrrrrrrGrrwrrrrrYrXrVrTrUrrzryrrtruncater3)rrrrrr9rrr extra_datarrrlrNrr0pos2 centDirCount centDirSize centDirOffsetr zip64endrec zip64locrecrds rrzZipFile._write_end_records ]]EB!ut|)BqEQJ6A>GerkBqEQJ."Q%1*=GE,%% 3 U__- U001& * !OO % 3 3 ""[0 U001 * % 3 3 JK)*d; #[[CE N*qU|-&+-/9: , ""i/!-= $$0!, < !+u/D/DEO e.B.BCN"'"<"<"> Hikk"2"2N"'"5"5"+U-@-@'7"'))]I"%h-Z#emmBT"#U%8%8%:M:M"/1G GGMM' " GGMM( # GGMM* % GGMM%-- (g#jww||~4==) T^^+   - -*N [ (7N ; &5N ##">#D$EFF ++"$6 2%r2q!\<],K GGMM+ & ++))1dA7K GGMM+ &|V4Lk:6K z:M-/?<(-T]]9KM  f  dmm$ 99  GG     rc|jdkDsJ|xjdzc_|js|js|jyyy)Nrr!)rrrkr~s rr zZipFile._fpclose$sI!### A(8(8 HHJ)9rr)rN)F)NN)NNN)i)%rrrrrGrxrrrrrr r7r9r?rCrGrKrrsetterrJrMrTrlrorrrjrgrrrrrkrr rrrr r s , B(,%"%:$#^:>RV^@ P-d9 &  ^^   mEm^(1T 75$  +ZF.'+046D48'!R!,F,\|rr c.eZdZdZdeddfdZd dZdZy) r zDClass to create ZIP archives with Python library files and packages.rTrycFtj|||||||_y)N)rrQr )r r _optimize)rrirrQr optimizes rrzPyZipFile.__init__.s't$K$.  0!rNctj|}|rI||sA|jr4tjj |rdnd}t |d|dytjj |\}}tjj |rtjj|d}tjj|r|r|d|}n|}|jrt d|d ||j|d d |\}} |jr t d | |j|| ttj|} | jd| D]$} tjj|| } tjj| \} }tjj | rStjjtjj| ds|j| || |dk(s|r#|| s|jrt d| z|j| d d |\}} |jr t d | |j|| 'y|jr t d|ttj|D]} tjj|| } tjj| \} }|dk(sK|r#|| s|jrt d| zp|j| d d |\}} |jr t d | |j|| y|d ddk7r t!d|j|d d |\}} |jr t d| |j|| y)aAdd all files from "pathname" to the ZIP archive. If pathname is a package directory, search the directory and all package subdirectories recursively for all *.py and enter the modules into the archive. If pathname is a plain directory, listdir *.py and enter all modules. Else, pathname must be a Python *.py file and the module will be put into the archive. Added modules are always module.pyc. This method will compile the module.py into module.pyc if necessary. If filterfunc(pathname) is given, it is called with every argument. When it is False, the file or directory is skipped. rri z skipped by filterfuncNz __init__.pyrzAdding package inasrAdding) filterfunc.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"z Adding file)rrrrrrr{r8isfile _get_codenamerr+listdirremovesplitextwritepyrN)rpathnamebasenamerlabeldirrinitnamerardirlistrNrrootexts rrzPyZipFile.writepy4s99X& j2zz"$''--"9vuhGH GGMM(+ T 77== "ww||Hm>"'',,t]*KL LLx4>)@%j.>#zz %&E&L M$)-););D2J#zz %&E&L M$)-););D2J._compiles\ zzk4( ""4"I,, cgg s4A"AA"rz.pycr) optimizationr!r"rz"invalid value for 'optimize': {!r})rrrx) importlibutilcache_from_sourcerrrrrrrr2rformatrr{) rrrrfile_pyfile_pyc pycache_opt0 pycache_opt1 pycache_opt2rrar archivenames ` rrzPyZipFile._get_codenames e#f$ ~~77b7Q  ~~77a7P  ~~77a7P >>R x(''(#,,0@0I0II"**%''...'','00BGGG4D4M4MM%"''...'','00BGGG4D4M4MM%"''...'','00BGGG4D4M4MM%"G$yy))Q. ,++q0 , ,&G&--EG~~"$"">>Q&(E^^q((E>EEdnnUC$S/)GGNN5)GGEN++rwww/?/H/HH$..A&--EGggmmG,Q/ %-{;K{##r)rN)rrrrrrrrrrrr r +s!N"%: 2" P'dP$rr cddl}d}|j|}|jd}|jdddd |jd d d dd|jddddd|jdddd |jddd |j |}|j }|j [|j }t|d|5}|j}dddrtdj|tdy|j4|j}t|d|5}|jdddy|j8|j\}} t|d|5}|j| dddy|j|r0td t j"!t!j$d"|jj'd} |j} fd#t| d$5}| D]} t(j*j-| } | szShow listing of a zipfile)metavarhelpz-ez --extractr")rz zExtract zipfile into target dir)nargsrrz-cz--create+)zzzCreate zipfile from sourcesz-tz--testzTest if a zipfile is validz--metadata-encodingz z2Specify encoding of member names for -l, -e and -tr)rz.The following enclosed file is corrupted: {!r}z Done testingz/Non-conforming encodings not supported with -c.r=r!c tjj|r|j||tytjj |r~|r|j||t tj|D]H}|tjj||tjj||Jyyr) rrrrrrr+rr8)rrzippathnmaddToZips rrzmain..addToZip sww~~d#w 5t$HHT7+ D!12BRWW\\$3RWW\\'25NP3%rrr)argparseArgumentParseradd_mutually_exclusive_group add_argument parse_argsrtestr rCrrr{r?rlrocreaterstderrexitpoprrrr\rr)argsrrparsergroupencodingrrbadfilerzip_namefilesrrrs @rmainrsGK  $ $ $ =F  / / / >E tX{79 t[<=? tZs39; tX{8: -|QS   T "D%%H yyii S# :bjjlG;  BII'R S n  ii S# :b KKM; :  !ll V S# :b MM& !; :   Czz # HHQK;;??1%  PXs #r''**40 gg..rwwt/DEGr299bii88 GT7+ $ #) !!; :; : ; :.$ #s1J4KK BK4J>K  KK")r CompleteDirsr)rbinasciiimportlib.utilrrrrrrSrrrrMr ImportErrorrOr(__all__ Exceptionrrrrrrr}rrrr rrrrr)rzryrrxrZr[r\r]r^r_r`rrrar!r#r r"_CD_CREATE_VERSION_CD_CREATE_SYSTEM_CD_EXTRACT_VERSION_CD_EXTRACT_SYSTEMr%_CD_COMPRESS_TYPE_CD_TIME_CD_DATE_CD_CRC_CD_COMPRESSED_SIZE_CD_UNCOMPRESSED_SIZEr$r&r'_CD_DISK_NUMBER_START_CD_INTERNAL_FILE_ATTRIBUTES_CD_EXTERNAL_FILE_ATTRIBUTESr(r^rfrrYrZrrrrUrV_FH_EXTRACT_VERSION_FH_EXTRACT_SYSTEMr[_FH_COMPRESSION_METHOD_FH_LAST_MOD_TIME_FH_LAST_MOD_DATE_FH_CRC_FH_COMPRESSED_SIZE_FH_UNCOMPRESSED_SIZErWrXrTrUrQrYrXrV_CD64_SIGNATURE_CD64_DIRECTORY_RECSIZE_CD64_CREATE_VERSION_CD64_EXTRACT_VERSION_CD64_DISK_NUMBER_CD64_DISK_NUMBER_START_CD64_NUMBER_ENTRIES_THIS_DISK_CD64_NUMBER_ENTRIES_TOTAL_CD64_DIRECTORY_SIZE_CD64_OFFSET_START_CENTDIRrStructr4rBrHr rtrDrobjectr rrrr!r5rrRrZr_rar{rrrr r r_pathrrrrrr$s    JJE     9    #        !12    $  !12     !!  #   "  !12  ! %))&//*CD"""6??#56!" #fmmE** 9x9v&ivi`   #L"".8wxxx  x  x yzy{   !"#(N&  P$(!(!V(V""Vr P+B%%P+ha a Hk$k$\C,LWH D NNE  C  Ds4I I$I2 I! I!$I/.I/2I=<I=lib64/python3.12/xml/__pycache__/__init__.cpython-312.pyc000064400000001305152351040030016553 0ustar00 ֦i-dZgdZy)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. )domparserssaxetreeN)__doc____all__%/usr/lib64/python3.12/xml/__init__.pyr s& -r lib64/python3.12/sqlite3/__pycache__/__init__.cpython-312.pyc000064400000003445152351330750017361 0ustar00 ֦i ,dZddlddlmZmZmZdZy)u The sqlite3 extension module provides a DB-API 2.0 (PEP 249) compliant interface to the SQLite library, and requires SQLite 3.7.15 or newer. To use the module, start by creating a database Connection object: import sqlite3 cx = sqlite3.connect("test.db") # test.db will be created or opened The special path name ":memory:" can be provided to connect to a transient in-memory database: cx = sqlite3.connect(":memory:") # connect to a database in RAM Once a connection has been established, create a Cursor object and call its execute() method to perform SQL queries: cu = cx.cursor() # create a table cu.execute("create table lang(name, first_appeared)") # insert values into a table cu.execute("insert into lang values (?, ?)", ("C", 1972)) # execute a query and iterate over the result for row in cu.execute("select * from lang"): print(row) cx.close() The sqlite3 module is written by Gerhard Häring . )*)_deprecated_names_deprecated_version_info_deprecated_versionc|tvr(ddlm}||dtdt d|St dt d|) Nr)warnz1 is deprecated and will be removed in Python 3.14) stacklevel _deprecated_zmodule z has no attribute )rwarningsrDeprecationWarningglobalsAttributeError__name__)namers )/usr/lib64/python3.12/sqlite3/__init__.py __getattr__r?sR   ! vF G A /y<v.// 78,.@I JJN)__doc__sqlite3.dbapi2rrrrrrrs . D11 Krlib64/python3.12/xml/sax/__pycache__/__init__.cpython-312.pyc000064400000007313152351617070017371 0ustar00 ֦i $dZddlmZddlmZmZddlmZmZm Z m Z m Z efdZ efdZ dgZdZerdd lZdd lZdd lZej(j*s,d ej,vrej,d j/d Z[[dd Zd Zy )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) SAXExceptionSAXNotRecognizedExceptionSAXParseExceptionSAXNotSupportedExceptionSAXReaderNotAvailablec~t}|j||j||j|y)N) make_parsersetContentHandlersetErrorHandlerparse)sourcehandler errorHandlerparsers )/usr/lib64/python3.12/xml/sax/__init__.pyrrs1 ]F W% <( LLcTddl}| t}t}|j||j |t }t |tr!|j|j|n |j|j||j|y)N) iorr r rr isinstancestrsetCharacterStreamStringIO setByteStreamBytesIOr)stringrrrrinpsrcs r parseStringr!#s #~ ]F W% <( ]F&#!!"++f"56RZZ/0 LLrzxml.sax.expatreaderrN PY_SAX_PARSER,ct|tzD]} t|cSt dd#t$rddl}||j vrY>  !+. .? 2D 99  ckk)*%   s 1AAAc@t|iidg}|jS)N create_parser) __import__r.)r, drv_modules rr'r'\s$K2.?@J  # # %%r))__doc__ xmlreaderrrrr _exceptionsrrrr r rr!r&_falsexml.sax.expatreaderxmlosr)flagsignore_environmentenvironsplitr r'r1rrr=s*#1.. )5 /;n $--   yy##2::(E**_5;;C@:4&rusr/lib64/python3.12/ensurepip/__pycache__/__init__.cpython-312.pyc000064400000022401152351675260020621 0ustar00 ֦i$ddlZddlZddlZddlZddlZddlZddlZddlmZddgZ dZ dZ de dfgZ ejd d Zejd ad Zd ZdaddZdZdZddddddddZddddddddZdddZddZy)N) resourcesversion bootstrap)pipz25.0.1rpy3Package)r wheel_name wheel_path WHEEL_PKG_DIRci} tj|}t|}|D]}|j dst D]}|dz}|j |sn9|j|jdd}tjj||}t|d|||<|S#t$rd}YwxYw)Nz.whl-r) oslistdirOSErrorsortedendswith_PACKAGE_NAMES startswith removeprefix partitionpathjoin_Package)rpackages filenamesfilenamenameprefixrr s +/usr/lib64/python3.12/ensurepip/__init__.py_find_packagesr!sHJJt$ y!I  ( "DCZF""6*# ''/99#>qAWW\\$1 !'4< O-  sB66 CCcttSi}tD]!\}}}|d|d|d}t||d||<#tr)t tt fdt Dr}|a|S)Nrz -none-any.whlc3&K|]}|v ywNr ).0r dir_packagess r z _get_packages..Gs?t|#s) _PACKAGES _PROJECTSr_WHEEL_PKG_DIRr!allr)rrrpy_tagr r&s @r _get_packagesr-;s{H!*gvvQwiq > !':t<"+%n5 ?? ?#HI Ocd|xsgd|d}tjddd|g}tjjr|j ddt j |d jS) 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-Wzignore::DeprecationWarningz-cz-IT)check)sys executableflagsisolatedinsert subprocessrun returncode)argsadditional_pathscodecmds r _run_pipr>Nsz    " #$v  D  $   C yy 1d >>#T * 5 55r.c0tdjS)zA Returns a string specifying the bundled version of pip. r)r-rr r.r rrhs ?5 ! ) ))r.ctjDcgc]}|jds|}}|D]}tj|=tjtjd<ycc}w)NPIP_PIP_CONFIG_FILE)renvironrdevnull)kkeys_to_removes r #_disable_pip_configuration_settingsrGosW"$DAq||F/CaND  JJqM%'JJBJJ ! Es A*A*Frootupgradeuser altinstall default_pip verbosityc&t||||||y)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. rHN) _bootstraprHs r rr{sD'$+"$r.c|r |r tdtjd|t|rdtj d<n|sdtj d<t j5}g}tjD]\}} | jr8| j} tjddz | z } | j} nXt| jd5} | j!} d d d tj"j%| j} tj"j'|| }t|d 5} | j) d d d |j+|dd d d |g}|r|d|gz }|r|dgz }|r|dgz }|r |dd|zzgz }t-g|t.|cd d d S#1swYxYw#1swYsxYw#1swYy xYw)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.bootstraprLENSUREPIP_OPTIONSinstall ensurepip_bundledrbNwbz--no-cache-dirz --no-indexz --find-links--root --upgrade--userrv) ValueErrorr2auditrGrrCtempfileTemporaryDirectoryr-itemsr rfiles read_bytesopenr readrbasenamerwriteappendr>r)rIrJrKrLrMrNtmpdirr;rpackager r whlfprr:s r rPrPskIJJII#T*')*6 &' *3 &'  $ $ &&*_224MD'!!$// &__[9JFS  ++-',,d3r'')C4WW--g.@.@A ww||FJ7Hh% &  # #H -!5&+\>6R  Xt$ $D  [M !D  XJ D  S3?*+ +D0$002BCC ' &43 &%# ' &s?/A;G(*G;AG(G*AG(G G(G% !G((G1)rNc& ddl}t}|j|k7r-t d|jd|dt j ytgd}|r |dd |zzgz }tg|ttS#t$rYywxYw) z~Helper to support a clean default uninstall process on Windows Note that calling this function may alter os.environ. rNz2ensurepip will only uninstall a matching version (z installed, z available))file) uninstallz-yz--disable-pip-version-checkrr[) r ImportErrorr __version__printr2stderrrGr>reversedr)rNravailable_versionr:s r _uninstall_helperrus    ++ //$L"%[2::  ') >D sY&'' 6d6Xn56 77) sB BBcBddl}|jd}|jdddjt d|jd d d dd d |jddddd|jdddd|jddd|jdddd|jdddd|j |}t |j|j|j|j|j|jS)Nrzpython -m ensurepip)progz --versionrzpip {}z9Show the version of pip that is bundled with this Python.)actionrhelpz-vz --verbosecountrNzDGive more output. Option is additive, and can be used up to 3 times.)rxdefaultdestryz-UrY store_trueFz8Upgrade pip and dependencies, even if already installed.)rxr{ryrZzInstall using the user scheme.rXz=Install everything relative to this alternate root directory.)r{ryz --altinstallz]Make an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y).z --default-pipz`Make a default pip install, installing the unqualified pip in addition to the versioned scripts.)rIrJrKrNrLrM) argparseArgumentParser add_argumentformatr parse_argsrPrIrJrKrNrLrM)argvr~parserr:s r _mainrs^  $ $*? $ @F  * H    k    k G    -    L  1  6    T "D  YY YY..??$$  r.r$) collectionsros.pathr7r2 sysconfigr^ importlibr__all__r _PIP_VERSIONr) namedtuplerget_config_varr*r!r-r(r>rrGrrPrurr r.r rs   k "  L%   "; ! !)"I K*))/::  64* /EE $UE>D@$%8>:r.usr/lib64/python3.12/logging/__pycache__/__init__.cpython-312.pyc000064400000272236152352343410020240 0ustar00 ֦iE ~dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl mZddl mZgdZddlZdZdZd Zd ZejZd Zd Zd Zd Zd Zd ZeZd ZdZ e Z!dZ"dZ#dZ$edede de"de#de$diZ%eeee e e"e#e$dZ&dZ'dZ(dZ)e*edrdZ+ndZ+ejXj[e)j\j^Z0dZ1dZ2ejfZ4d Z5d!Z6e*ed"sd#Z7n,ejpZ9d$Z7d%Z:ejve5e:e6&Gd'd(e<Z=e=a>d)Z?d*Z@d+ZAeZB[Gd,d-e<ZCGd.d/eCZDGd0d1eCZEd2ZFeCeFfeDd3feEd4fd5ZGGd6d7e<ZeZHGd8d9e<ZIGd:d;e<ZJGd<d=e<ZKejZMgZNd>ZOd?ZPd@ZQdAZRGdBdCeKZSGdDdEeSZTGdFdGeTZUGdHdIeTZVeVe ZWeWZXGdJdKe<ZYdLZZdMZ[GdNdOe<Z\GdPdQeKZ]GdRdSe]Z^e]a_GdTdUe<Z`e^e Zaeae]_ae\e]je]_bdVZcdhdWZddXZedYZfdZZgd d[d\Zhd]Zid^Zjd_Zkd`ZldaZmefdbZneNfdcZoddlpZpepjeoGdddeeSZrdasdidfZtdgZuy)jz Logging package for Python. Based on PEP 282 and comments thereto in comp.lang.python. Copyright (C) 2001-2022 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! N) GenericAlias)Template) Formatter)- BASIC_FORMATBufferingFormatterCRITICALDEBUGERRORFATAL FileHandlerFilterrHandlerINFO LogRecordLogger LoggerAdapterNOTSET NullHandler StreamHandlerWARNWARNING addLevelName basicConfigcaptureWarningscriticaldebugdisableerror exceptionfatal getLevelName getLoggergetLoggerClassinfolog makeLogRecordsetLoggerClassshutdownwarnwarninggetLogRecordFactorysetLogRecordFactory lastResortraiseExceptionsgetLevelNamesMappinggetHandlerByNamegetHandlerNamesz&Vinay Sajip productionz0.5.1.2z07 February 2010T2( rr rrr r)rr r rrrr rc*tjSN) _nameToLevelcopy)/usr/lib64/python3.12/logging/__init__.pyr/r/~s    r=cptj|}||Stj|}||Sd|zS)a Return the textual or numeric representation of logging level 'level'. If the level is one of the predefined levels (CRITICAL, ERROR, WARNING, INFO, DEBUG) then you get the corresponding string. If you have associated levels with names using addLevelName then the name you have associated with 'level' is returned. If a numeric value corresponding to one of the defined levels is passed in, the corresponding string representation is returned. If a string representation of the level is passed in, the corresponding numeric value is returned. If no matching numeric or string value is passed in, the string 'Level %s' % level is returned. zLevel %s) _levelToNamegetr:)levelresults r>r!r!sE&  e $F    e $F   r=cpt |t|<|t|<ty#twxYw)zy Associate 'levelName' with 'level'. This is used when converting levels to text during message formatting. N) _acquireLockr@r: _releaseLock)rB levelNames r>rrs- N' U"' Y s) 5 _getframec,tjdS)N)sysrHr<r=r>rLs 3==+r=c| t#t$r*}|jjjcYd}~Sd}~wwxYw)z5Return the frame object for the caller's stack frame.N) Exception __traceback__tb_framef_back)excs r> currentframerSs4 5O 5$$--44 4 5s ;6;;ctjj|jj}|t k(xs d|vxrd|vS)zASignal whether the frame is a CPython or logging module internal. importlib _bootstrap)ospathnormcasef_code co_filename_srcfile)framefilenames r>_is_internal_framer_sDww 8 89H x  x _checkLevelrgsg%  I Uu   $0589 9 %  I #$ $r=c:trtjyy)z Acquire the module-level lock for serializing access to shared data. This should be released with _releaseLock(). N)_lockacquirer<r=r>rErEs    r=c:trtjyy)zK Release the module-level lock acquired by calling _acquireLock(). N)rireleaser<r=r>rFrFs   r=register_at_forkcyr9r<instances r>_register_at_fork_reinit_lockrq r=cvt tj|ty#twxYwr9)rE_at_fork_reinit_lock_weaksetaddrFros r>rqrqs%  ( , ,X 6 NLNs, 8cbtD]}|jtjyr9)rt_at_fork_reinitrihandlers r>!_after_at_fork_child_reinit_locksrz s&3G  # # %4 r=)beforeafter_in_childafter_in_parentc&eZdZdZ ddZdZdZy)ra A LogRecord instance represents an event being logged. LogRecord instances are created every time something is logged. They contain all the information pertinent to the event being logged. The main information passed in is in msg and args, which are combined using str(msg) % args to create the message field of the record. The record also includes information such as when the record was created, the source line where the logging call was made, and any exception information to be logged. Nc  tj} ||_||_|r?t|dk(r1t |dt j jr |dr|d}||_t||_ ||_ ||_ tjj||_tjj#|j d|_||_d|_| |_||_||_| |_t9| t9| z dzdz|_|j6t<z dz|_t@r=tCjD|_#tCjHj|_%nd|_#d|_%tLsd|_'nHd|_'tPjRjUd} | | jWj|_'tZr*t]td rtj^|_0nd|_0d|_1tdrGtPjRjUd } | r% | jgji|_1yyy#t&t(t*f$r||_d|_YwxYw#tX$rYwxYw#tX$rYywxYw) zK Initialize a logging record with interesting information. rJrzUnknown moduleNig MainProcessmultiprocessinggetpidasyncio)5timenamemsglenra collectionsabcMappingargsr! levelnamelevelnopathnamerWrXbasenamer^splitextmodulererdAttributeErrorexc_infoexc_text stack_infolinenofuncNamecreatedrbmsecs _startTimerelativeCreated logThreads threading get_identthreadcurrent_thread threadNamelogMultiprocessing processNamerKmodulesrAcurrent_processrN logProcesseshasattrrprocesstaskNamelogAsyncioTasks current_taskget_name)selfrrBrrrrrfuncsinfokwargsctmprs r>__init__zLogRecord.__init__*sB YY[ & SY!^ 47KOO)rrrrrrs r>__repr__zLogRecord.__repr__{s,48IIt|| MM4;;2 2r=cft|j}|jr||jz}|S)z Return the message for this LogRecord. Return the message for this LogRecord after merging any user-supplied arguments with the message. )rcrr)rrs r> getMessagezLogRecord.getMessages*$((m 99 /C r=NN)__name__ __module__ __qualname____doc__rrrr<r=r>rrs 8<Ob2 r=rc|ay)z Set the factory to be used when instantiating a log record. :param factory: A callable which will be called to instantiate a log record. N_logRecordFactory)factorys r>r,r,s  r=ctS)zH Return the factory to be used when instantiating a log record. rr<r=r>r+r+s r=c `tdddddddd}|jj||S)z Make a LogRecord whose attributes are defined by the specified dictionary, This function is useful for converting a logging event received over a socket connection (which is sent as a dictionary) into a LogRecord instance. Nrr<)r__dict__update)dictrfs r>r&r&s3 4r1b"dD ABKKt Ir=cveZdZdZdZdZejdejZ dddZ dZ d Z d Z d Zy) PercentStylez %(message)sz %(asctime)sz %(asctime)z5%\(\w+\)[#0+ -]*(\*|\d+)?(\.(\*|\d+))?[diouxefgcrsa%]Ndefaultsc<|xs |j|_||_yr9)default_format_fmt _defaults)rfmtrs r>rzPercentStyle.__init__s.4.. !r=cR|jj|jdk\S)Nrrfindasctime_searchrs r>usesTimezPercentStyle.usesTimes yy~~d112a77r=c|jj|js)td|jd|jddy)z>Validate the input format, ensure it matches the correct stylezInvalid format 'z' for 'rz' styleN)validation_patternsearchrrdrrs r>validatezPercentStyle.validates@&&--dii8TYYPTPcPcdePfgh h9r=ct|jx}r||jz}n |j}|j|zSr9)rrrrrecordrvaluess r>_formatzPercentStyle._formats7~~ %8 %/F__Fyy6!!r=cd |j|S#t$r}td|zd}~wwxYw)Nz(Formatting field not found in record: %s)rKeyErrorrd)rres r>formatzPercentStyle.formats: M<<' ' MG!KL L Ms /*/)rrrrasctime_formatrrecompileIrrrrrrr<r=r>rrsJ"N"N!N#$\^`^b^bc(,"8i "Mr=rceZdZdZdZdZejdejZ ejdZ dZ dZ y) StrFormatStylez {message}z {asctime}z{asctimezF^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$z^(\d+|\w+)(\.\w+|\[[^]]+\])*$c|jx}r||jz}n |j}|jjdi|SNr<)rrrrrs r>rzStrFormatStyle._formatsB~~ %8 %/F__Ftyy)&))r=ct} tj|jD]\}}}}|r:|jj |st d|z|j||r|dvrt d|z|s[|jj |rwt d|z |s t dy#t $r}t d|zd}~wwxYw)zKValidate the input format, ensure it is the correct string formatting stylez!invalid field name/expression: %rrsazinvalid conversion: %rzbad specifier: %rzinvalid format: %sNinvalid format: no fields) set_str_formatterparser field_specmatchrdrufmt_spec)rfields_ fieldnamespec conversionrs r>rzStrFormatStyle.validates 72@2F2Ftyy2Q.9dJ??00;()Ly)XYYJJy)*E"9$%= %JKK 3 3D 9$%84%?@@3R89 9 71A56 6 7s$A9CC"C C CCN) rrrrrrrrrrrrrr<r=r>rrsF N NNrzzcegeieijH<=J*:r=rc<eZdZdZdZdZfdZdZdZdZ xZ S)StringTemplateStylez ${message}z ${asctime}cXt||i|t|j|_yr9)superrrr_tpl)rrr __class__s r>rzStringTemplateStyle.__init__s% $)&)TYY' r=c|j}|jddk\xs|j|jdk\S)Nz$asctimerrrrs r>rzStringTemplateStyle.usesTimes8iixx #q(NCHHT5H5H,IQ,NNr=cXtj}t}|j|jD]e}|j }|dr|j |d-|dr|j |dG|jddk(s\td|s tdy)Nnamedbracedr$z$invalid format: bare '$' not allowedr) rpatternrfinditerr groupdictrugrouprd)rrrmds r>rzStringTemplateStyle.validates""!!$)),A Az 1W:&8 1X;'s" !IJJ-89 9r=c|jx}r||jz}n |j}|jjdi|Sr)rrr substituters r>rzStringTemplateStyle._formatsB~~ %8 %/F__F#tyy##-f--r=) rrrrrrrrrr __classcell__)rs@r>rrs'!N!N!N(O :.r=rz"%(levelname)s:%(name)s:%(message)sz{levelname}:{name}:{message}z${levelname}:${name}:${message})%{rcdeZdZdZej Zd dddZdZdZ ddZ dZ d Z d Z d Zd Zy)ra Formatter instances are used to convert a LogRecord to text. Formatters need to know how a LogRecord is constructed. They are responsible for converting a LogRecord to (usually) a string which can be interpreted by either a human or an external system. The base Formatter allows a formatting string to be specified. If none is supplied, the style-dependent default value, "%(message)s", "{message}", or "${message}", is used. The Formatter can be initialized with a format string which makes use of knowledge of the LogRecord attributes - e.g. the default value mentioned above makes use of the fact that the user's message and arguments are pre- formatted into a LogRecord's message attribute. Currently, the useful attributes in a LogRecord are described by: %(name)s Name of the logger (logging channel) %(levelno)s Numeric logging level for the message (DEBUG, INFO, WARNING, ERROR, CRITICAL) %(levelname)s Text logging level for the message ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL") %(pathname)s Full pathname of the source file where the logging call was issued (if available) %(filename)s Filename portion of pathname %(module)s Module (name portion of filename) %(lineno)d Source line number where the logging call was issued (if available) %(funcName)s Function name %(created)f Time when the LogRecord was created (time.time() return value) %(asctime)s Textual time when the LogRecord was created %(msecs)d Millisecond portion of the creation time %(relativeCreated)d Time in milliseconds when the LogRecord was created, relative to the time the logging module was loaded (typically at application startup time) %(thread)d Thread ID (if available) %(threadName)s Thread name (if available) %(taskName)s Task name (if available) %(process)d Process ID (if available) %(message)s The result of record.getMessage(), computed just as the record is emitted Nrc|tvr/tddjtjzt|d|||_|r|jj |jj |_||_y)a Initialize the formatter with specified format strings. Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format. Use a style parameter of '%', '{' or '$' to specify that you want to use one of %-formatting, :meth:`str.format` (``{}``) formatting or :class:`string.Template` formatting in your format string. .. versionchanged:: 3.2 Added the ``style`` parameter. Style must be one of: %s,rrN)_STYLESrdjoinkeys_stylerrdatefmt)rrrstylerrs r>rzFormatter.__init__Psw"  7#(($\\^;--. .enQ'h?  KK "KK$$  r=z%Y-%m-%d %H:%M:%Sz%s,%03dc|j|j}|rtj||}|Stj|j|}|j r|j ||j fz}|S)a% Return the creation time of the specified LogRecord as formatted text. This method should be called from format() by a formatter which wants to make use of a formatted time. This method can be overridden in formatters to provide for any specific requirement, but the basic behaviour is as follows: if datefmt (a string) is specified, it is used with time.strftime() to format the creation time of the record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used. The resulting string is returned. This function uses a user-configurable function to convert the creation time to a tuple. By default, time.localtime() is used; to change this for a particular formatter instance, set the 'converter' attribute to a function with the same signature as time.localtime() or time.gmtime(). To change it for all formatters, for example if you want all logging times to be shown in GMT, set the 'converter' attribute in the Formatter class. ) converterrrstrftimedefault_time_formatdefault_msec_formatr)rrrrss r> formatTimezFormatter.formatTimenso$^^FNN +  gr*A  d66;A'',,6<formatExceptionzFormatter.formatExceptionsikkm U !!"Q%AD#> LLN RS6T>#2Ar=c6|jjS)zK Check if the format uses the creation time of the record. )rrrs r>rzFormatter.usesTimes{{##%%r=c8|jj|Sr9)rrrrs r> formatMessagezFormatter.formatMessages{{!!&))r=c|S)aU This method is provided as an extension point for specialized formatting of stack information. The input data is a string as returned from a call to :func:`traceback.print_stack`, but with the last trailing newline removed. The base implementation just returns the value passed in. r<)rrs r> formatStackzFormatter.formatStacks r=c|j|_|jr!|j||j|_|j |}|jr,|js |j|j|_|jr|dddk7r|dz}||jz}|jr+|dddk7r|dz}||j|jz}|S)az Format the specified record as text. The record's attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message. r$Nr%) rmessagerr!rasctimer3rrr/rr5)rrr s r>rzFormatter.formats **, ==?!__VT\\BFN   v & ????"&"6"6v"G ??v~HFOO#A   v~HD$$V%6%677Ar=)NNrTr9)rrrrr localtimerrrrr!r/rr3r5rr<r=r>rr"sL)VI6.#6&& * r=rc*eZdZdZddZdZdZdZy)rzB A formatter suitable for formatting a number of records. Nc.|r||_yt|_y)zm Optionally specify a formatter which will be used to format each individual record. N)linefmt_defaultFormatter)rr<s r>rzBufferingFormatter.__init__s "DL,DLr=cy)zE Return the header string for the specified records. rr<rrecordss r> formatHeaderzBufferingFormatter.formatHeaderr=cy)zE Return the footer string for the specified records. rr<r?s r> formatFooterzBufferingFormatter.formatFooterrBr=cd}t|dkDrM||j|z}|D] }||jj|z}"||j |z}|S)zQ Format the specified records and return the result as a string. rr)rrAr<rrD)rr@rfrs r>rzBufferingFormatter.formatsg wrrs-  r=rceZdZdZddZdZy)r a Filter instances are used to perform arbitrary filtering of LogRecords. Loggers and Handlers can optionally use Filter instances to filter records as desired. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with "A.B" will allow events logged by loggers "A.B", "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If initialized with the empty string, all events are passed. c2||_t||_y)z Initialize a filter. Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event. N)rrnlenrrs r>rzFilter.__init__ s I r=c|jdk(ry|j|jk(ry|jj|jd|jdk7ry|j|jdk(S)z Determine if the specified record is to be logged. Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place. rTF.)rHrrr2s r>filterz Filter.filtersc 99> YY&++ % [[  diiDII 6! ; DII&#-.r=N)r)rrrrrrLr<r=r>r r s   /r=r c(eZdZdZdZdZdZdZy)Filtererz[ A base class for loggers and handlers which allows them to share common code. cg|_y)zE Initialize the list of filters to be an empty list. N)filtersrs r>rzFilterer.__init__+s  r=cX||jvr|jj|yy)z; Add the specified filter to this handler. N)rPappendrrLs r> addFilterzFilterer.addFilter1s'$,,& LL   ''r=cX||jvr|jj|yy)z@ Remove the specified filter from this handler. N)rPremoverSs r> removeFilterzFilterer.removeFilter8s' T\\ ! LL   ' "r=c|jD]?}t|dr|j|}n||}|syt|ts>|}A|S)a Determine if a record is loggable by consulting all the filters. The default is to allow the record to be logged; any filter can veto this by returning a false value. If a filter attached to a handler returns a log record instance, then that instance is used in place of the original log record in any further processing of the event by that handler. If a filter returns any other true value, the original log record is used in any further processing of the event by that handler. If none of the filters return false values, this method returns a log record. If any of the filters return a false value, this method returns a false value. .. versionchanged:: 3.2 Allow filters to be just callables. .. versionchanged:: 3.12 Allow filters to return a LogRecord instead of modifying it in place. rLF)rPrrLrar)rrfrCs r>rLzFilterer.filter?sO2Aq(#&)6&), r=N)rrrrrrTrWrLr<r=r>rNrN&s (("r=rNcttt}}}|r'|r$|r!| |j||yyyy#t$rYwxYw#|wxYw)zD Remove a handler reference from the internal cleanup list. N)rErF _handlerListrVrd)wrrjrlhandlerss r>_removeHandlerRefr^jsZ".|\hWG7x   OOB  I (7w    Is!= A A A  A Act tjtj|t t y#t wxYw)zL Add a handler to the internal cleanup list using a weak reference. N)rEr[rRweakrefrefr^rFrxs r>_addHandlerRefrb|s3NGKK1BCD s -A Ac,tj|S)za Get a handler with the specified *name*, or None if there isn't one with that name. ) _handlersrArs r>r0r0s == r=cRttj}t|S)z= Return all known handler names as an immutable set. )rrdr frozenset)rCs r>r1r1s ! "F V r=ceZdZdZefdZdZdZeeeZ dZ dZ dZ dZ d Zd Zd Zd Zd ZdZdZdZdZy)raq Handler instances dispatch logging events to specific destinations. The base handler class. Acts as a placeholder which defines the Handler interface. Handlers can optionally use Formatter instances to format records as desired. By default, no formatter is specified; in this case, the 'raw' message as determined by record.message is logged. ctj|d|_t||_d|_d|_t||jy)zz Initializes the instance - basically setting the formatter to None and the filter list to empty. NF) rNr_namergrB formatter_closedrb createLockrrBs r>rzHandler.__init__sE $  '  t r=c|jSr9)rjrs r>rzHandler.get_names zzr=ct |jtvrt|j=||_|r |t|<ty#twxYwr9)rErjrdrFrIs r>set_namezHandler.set_namesB zzY&djj)DJ"& $ NLNs 5A AcLtj|_t|y)zU Acquire a thread lock for serializing access to the underlying I/O. N)rRLocklockrqrs r>rmzHandler.createLocksOO% %d+r=c8|jjyr9)rtrwrs r>rwzHandler._at_fork_reinits !!#r=cR|jr|jjyy)z. Acquire the I/O thread lock. N)rtrjrs r>rjzHandler.acquire  99 II    r=cR|jr|jjyy)z. Release the I/O thread lock. N)rtrlrs r>rlzHandler.releaserwr=c$t||_y)zX Set the logging level of this handler. level must be an int or a str. N)rgrBrns r>setLevelzHandler.setLevels!' r=cb|jr |j}nt}|j|S)z Format the specified record. If a formatter is set, use it. Otherwise, use the default formatter for the module. )rkr=r)rrrs r>rzHandler.formats( >>..C#Czz&!!r=ctd)z Do whatever it takes to actually log the specified logging record. This version is intended to be implemented by subclasses and so raises a NotImplementedError. z.emit must be implemented by Handler subclasses)NotImplementedErrorr2s r>emitz Handler.emits"#:; ;r=c|j|}t|tr|}|r4|j |j ||j |S|S#|j wxYw)a Conditionally emit the specified logging record. Emission depends on filters which may have been added to the handler. Wrap the actual emission of the record with acquisition/release of the I/O thread lock. Returns an instance of the log record that was emitted if it passed all filters, otherwise a false value is returned. )rLrarrjr~rl)rrrfs r>handlezHandler.handles][[  b) $F LLN  &!  r  s AA.c||_y)z5 Set the formatter for this handler. N)rkrs r> setFormatterzHandler.setFormatter s r=cy)z Ensure all logging output has been flushed. This version does nothing and is intended to be implemented by subclasses. Nr<rs r>flushz Handler.flushs r=ct d|_|jr#|jtvrt|j=t y#t wxYw)a% Tidy up any resources used by the handler. This version removes the handler from an internal map of handlers, _handlers, which is used for handler lookup by name. Subclasses should ensure that this gets called from overridden close() methods. TN)rErlrjrdrFrs r>r+z Handler.closes>  DLzzdjjI5djj) NLNs 6A Ac>trtjrtj\}}} tjj dt j |||dtjtjj d|j}|rtjj|jjtdk(rL|j}|r>tjj|jjtdk(rL|r&t j|tjn:tjj d|j d|j"d tjj d |j$d |j&d~~~yyy#t($rt*$r"tjj d Y9wxYw#t,$rYHwxYw#~~~wxYw) aD Handle errors which occur during an emit() call. This method should be called from handlers when an exception is encountered during an emit() call. If raiseExceptions is false, exceptions get silently ignored. This is what is mostly wanted for a logging system - most users will not care about errors in the logging system, they are more interested in application errors. You could, however, replace this with a custom handler if you wish. The record which was being processed is passed in to this method. z--- Logging error --- Nz Call stack: rfilezLogged from file z, line r%z Message: z Arguments: zwUnable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. )r.rKstderrrwriter(r)rPrWrXdirnamerZr[__path__rQ print_stackr^rrrRecursionErrorrNOSError)rrtvr.r]s r> handleErrorzHandler.handleError*s szz||~HAq"    !:;))!QD#**E   1 1I1I!J{"#!LLE1I1I!J{"#))%cjjAJJ$$%+__fmm&EF &JJ$$:@**:@++&GHq"C *?.& &JJ$$&R&&   q"sIC;H.A"H:G1HHHH HHHHHcft|j}d|jjd|dS)N< ()>)r!rBrrrns r>rzHandler.__repr__Ys%TZZ("nn55u==r=N)rrrrrrrrqpropertyrrmrwrjrlrzrr~rrrr+rrr<r=r>rrsk$   Hh 'D,$  ( ";,  $-^>r=rcDeZdZdZdZd dZdZdZdZdZ e e Z y) rz A handler class which writes logging records, appropriately formatted, to a stream. Note that this class does not close the stream, as sys.stdout or sys.stderr may be used. r%Nc`tj||tj}||_y)zb Initialize the handler. If stream is not specified, sys.stderr is used. N)rrrKrstreamrrs r>rzStreamHandler.__init__fs'  >ZZF r=c|j |jr0t|jdr|jj|j y#|j wxYw)z% Flushes the stream. rN)rjrrrrlrs r>rzStreamHandler.flushqsI  {{wt{{G< !!# LLNDLLNs r~zStreamHandler.emit|sd %++f%C[[F LLt. / JJL   %   V $ %sA A#A43A4c||jurd}|S|j}|j |j||_|j|S#|jwxYw)z Sets the StreamHandler's stream to the specified value, if it is different. Returns the old stream, if the stream was changed, or None if it wasn't. N)rrjrrl)rrrCs r> setStreamzStreamHandler.setStreams` T[[ F [[F LLN  $    s AA+ct|j}t|jdd}t |}|r|dz }d|j j d|d|dS)Nrr r(r)r!rBgetattrrrcrr)rrBrs r>rzStreamHandler.__repr__sOTZZ(t{{FB/4y  CKD $ 7 7uEEr=r9) rrrrrrrr~rr classmethodr__class_getitem__r<r=r>rr]s5 J  %,(F$L1r=rc0eZdZdZddZdZdZdZdZy) r zO A handler class which writes formatted logging records to disk files. Nctj|}tjj||_||_||_d|vrtj||_||_ ||_ t|_ |rtj|d|_yt j||j#y)zO Open the specified file and use it as the stream for logging. bN)rWfspathrXabspath baseFilenamemodeencodingr& text_encodingerrorsdelayopen _builtin_openrrrr_open)rr^rrrrs r>rzFileHandler.__init__s 99X&GGOOH5   d?,,X6DM  "    T "DK  " "4 6r=c|j |jrA |j|j}d|_t|dr|j  t j | |j y#|j}d|_t|dr|j wwxYw#t j |wxYw#|j wxYw)z$ Closes the stream. Nr+)rjrrrr+rrlrs r>r+zFileHandler.closes   *;;+ !%&* "673"LLN ##D) LLN"&&* "673"LLN4##D) LLNs3 B<B0B< C2B99B<<CCC(c|j}||j|j|j|jS)zx Open the current base file with the (original) mode and encoding. Return the resulting stream. rr)rrrrr)r open_funcs r>rzFileHandler._opens9 && **DII"&-- E Er=c|j0|jdk7s |js|j|_|jrtj ||yy)a- Emit a record. If the stream was not opened because 'delay' was specified in the constructor, open it before calling the superclass's emit. If stream is not open, current mode is 'w' and `_closed=True`, record will not be emitted (see Issue #42378). Nw)rrrlrrr~r2s r>r~zFileHandler.emitsI ;; yyCt||"jjl ;;   tV , r=ct|j}d|jjd|jd|dSNrrrr)r!rBrrrrns r>rzFileHandler.__repr__s-TZZ(!%!8!8$:K:KUSSr=)aNFN) rrrrrr+rr~rr<r=r>r r s"760E- Tr=r c*eZdZdZefdZedZy)_StderrHandlerz This class is like a StreamHandler using sys.stderr, but always uses whatever sys.stderr is currently set to rather than the value of sys.stderr at handler construction time. c0tj||y)z) Initialize the handler. N)rrrns r>rz_StderrHandler.__init__ s u%r=c"tjSr9)rKrrs r>rz_StderrHandler.streams zzr=N)rrrrrrrrr<r=r>rrs% $& r=rceZdZdZdZdZy) PlaceHolderz PlaceHolder instances are used in the Manager logger hierarchy to take the place of nodes for which no loggers have been defined. This class is intended for internal use only and not as part of the public API. c|di|_y)zY Initialize with the specified logger being a child of this placeholder. N loggerMapraloggers r>rzPlaceHolder.__init__%s#T+r=c@||jvrd|j|<yy)zJ Add the specified logger as a child of this placeholder. Nrrs r>rRzPlaceHolder.append+s# $.. (&*DNN7 # )r=N)rrrrrrRr<r=r>rrs , +r=rcj|tk7r(t|tstd|jz|ay)z Set the class to be used when instantiating a logger. The class should define __init__() such that only a name argument is required, and the __init__() should call Logger.__init__() (logger not derived from logging.Logger: N)r issubclassrer _loggerClass)klasss r>r'r'6s8  %(F#nn-. .Lr=ctS)zB Return the class to be used when instantiating a logger. )rr<r=r>r#r#Cs  r=cneZdZdZdZedZejdZdZdZ dZ dZ d Z d Z y ) Managerzt There is [under normal circumstances] just one Manager instance, which holds the hierarchy of loggers. cX||_d|_d|_i|_d|_d|_y)zT Initialize the manager with the root node of the logger hierarchy. rFN)rootremittedNoHandlerWarning loggerDict loggerClasslogRecordFactory)rrootnodes r>rzManager.__init__Ns1  ',$ $r=c|jSr9)_disablers r>rzManager.disableYs }}r=c$t||_yr9)rgrrvalues r>rzManager.disable]s#E* r=cd}t|ts tdt ||jvru|j|}t|t r|}|j xst|}||_||j|<|j|||j|nA|j xst|}||_||j|<|j|t|S#twxYw)a Get a logger with the specified name (channel name), creating it if it doesn't yet exist. This name is a dot-separated hierarchical name, such as "a", "a.b", "a.b.c" or similar. If a PlaceHolder existed for the specified name [i.e. the logger didn't exist but a child of it did], replace it with the created logger and fix up the parent/child references which pointed to the placeholder to now point to the logger. NzA logger name must be a string) rarcrerErrrrmanager_fixupChildren _fixupParentsrF)rrrfphs r>r"zManager.getLoggeras$$<= = t&__T*b+.B:$**:lDAB!%BJ,.DOOD)''B/&&r*6d&&6,=! (*%""2& N  Ns CC99 Dct|tk7r(t|tstd|jz||_y)zY Set the class to be used when instantiating a logger with this Manager. rN)rrrerr)rrs r>r'zManager.setLoggerClasss9 F?eV, J"'..!122 r=c||_y)zg Set the factory to be used when instantiating a log record with this Manager. N)r)rrs r>r,zManager.setLogRecordFactorys !(r=c|j}|jd}d}|dkDr|s|d|}||jvrt||j|<nE|j|}t |t r|}n#t |tsJ|j ||jdd|dz }|dkDr|s|s |j}||_y)z Ensure that there are either loggers or placeholders all the way from the specified logger to the root of the logger hierarchy. rKNrrJ) rrfindrrrarrRrparent)rrrirfsubstrobjs r>rzManager._fixupParentss || JJsO 1ub"1XFT__,*5g*>'oof-c6*B%c;777JJw' 31q5)A1ubBr=c|j}t|}|jjD]7}|jjd||k7s |j|_||_9y)zk Ensure that children of the placeholder ph are connected to the specified logger. N)rrrrr)rrrrnamelencs r>rzManager._fixupChildrensV ||d)""$Axx}}Xg&$.!"" %r=ct|jjD]-}t|ts|j j /|jj j ty)zj Clear the cache for all loggers in loggerDict Called when level changes are made N) rErrrar_cacheclearrrFrloggers r> _clear_cachezManager._clear_cachesW oo,,.F&&) ##%/  r=N)rrrrrrrsetterr"r'r,rrrr<r=r>rrIsW % ^^++ D!(0 # r=rceZdZdZefdZdZdZdZdZ dZ dZ d d d Z d Z d ZdZddZ ddZ d dZdZdZdZdZdZdZdZdZdZdZdZy)!rar Instances of the Logger class represent a single logging channel. A "logging channel" indicates an area of an application. Exactly how an "area" is defined is up to the application developer. Since an application can have any number of areas, logging channels are identified by a unique string. Application areas can be nested (e.g. an area of "input processing" might include sub-areas "read CSV files", "read XLS files" and "read Gnumeric files"). To cater for this natural nesting, channel names are organized into a namespace hierarchy where levels are separated by periods, much like the Java or Python package namespace. So in the instance given above, channel names might be "input" for the upper level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels. There is no arbitrary limit to the depth of nesting. ctj|||_t||_d|_d|_g|_d|_i|_ y)zJ Initialize the logger with a name and an optional level. NTF) rNrrrgrBr propagater]disabledr)rrrBs r>rzLogger.__init__sH $  '     r=cXt||_|jjy)zW Set the logging level of this logger. level must be an int or a str. N)rgrBrrrns r>rzzLogger.setLevels !'  !!#r=cb|jtr|jt||fi|yy)z Log 'msg % args' with severity 'DEBUG'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.debug("Houston, we have a %s", "thorny problem", exc_info=True) N) isEnabledForr _logrrrrs r>rz Logger.debug.   U # DIIeS$ 1& 1 $r=cb|jtr|jt||fi|yy)z Log 'msg % args' with severity 'INFO'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.info("Houston, we have a %s", "notable problem", exc_info=True) N)rrrrs r>r$z Logger.infos.   T " DIIdC 0 0 #r=cb|jtr|jt||fi|yy)z Log 'msg % args' with severity 'WARNING'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.warning("Houston, we have a %s", "bit of a problem", exc_info=True) N)rrrrs r>r*zLogger.warnings.   W % DIIgsD 3F 3 &r=cftjdtd|j|g|i|yNz6The 'warn' method is deprecated, use 'warning' insteadr#warningsr)DeprecationWarningr*rs r>r)z Logger.warn0 $%7 < S*4*6*r=cb|jtr|jt||fi|yy)z Log 'msg % args' with severity 'ERROR'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.error("Houston, we have a %s", "major problem", exc_info=True) N)rr rrs r>rz Logger.errorrr=Trc4|j|g|d|i|y)zU Convenience method for logging an ERROR with exception information. rNrrrrrrs r>rzLogger.exception"s!  3;;;F;r=cb|jtr|jt||fi|yy)z Log 'msg % args' with severity 'CRITICAL'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.critical("Houston, we have a %s", "major disaster", exc_info=True) N)rrrrs r>rzLogger.critical(s.   X & DIIhT 4V 4 'r=c0|j|g|i|y)z@ Don't use this method, use critical() instead. Nrrs r>r z Logger.fatal4s  c+D+F+r=ct|tstr tdy|j |r|j |||fi|yy)z Log 'msg % args' with the integer severity 'level'. To pass exception information, use the keyword argument exc_info with a true value, e.g. logger.log(level, "We have a %s", "mysterious problem", exc_info=True) zlevel must be an integerN)rarbr.rerrrrBrrrs r>r%z Logger.log:sJ%% :;;   U # DIIeS$ 1& 1 $r=ct}|y|dkDr'|j}|n|}t|s|dz}|dkDr'|j}d}|rbt j 5}|j dtj|||j}|ddk(r|dd}ddd|j|j|j|fS#1swY-xYw) z Find the stack frame of the caller so that we can note the source file name, line number and function name. N)(unknown file)r(unknown function)NrrJzStack (most recent call last): rr$r%) rSrQr_rZr&r'rr(rr*r[f_linenoco_name)rr stacklevelrYnext_fcorr-s r> findCallerzLogger.findCallerKs N 9B1nXXF~ A%a(a 1nXX # <=%%ac2 9$!#2JE  ~~qzz2::u<< s ACCNc t||||||||| } | 9| D]4} | dvs| | jvrtd| z| | | j| <6| S)zr A factory method which can be overridden in subclasses to create specialized LogRecords. )r7r8z$Attempt to overwrite %r in LogRecord)rrr) rrrBfnlnorrrrextrarrfkeys r> makeRecordzLogger.makeRecordmso tUBS$$"$  11sbkk7I"#IC#OPP#(: C  r=c d}tr |j||\} } } }nd\} } } |rMt|trt |||j f}n$t|tstj}|j|j|| | |||| || } |j| y#t$r d\} } } YwxYw)z Low-level logging routine which creates a LogRecord and then calls all the handlers of this logger to handle the record. N)rrr) r\rrdra BaseExceptiontyperOtuplerKrrrr) rrBrrrrrrrrrrrs r>rz Logger._log|s   J'+z:'N$CuFMBT (M2 NHh6L6LM%0<<>E2sC!)4? F J I C JsB--B?>B?c|jry|j|}|syt|tr|}|j |y)z Call the handlers for the specified record. This method is used for unpickled records received from a socket, as well as those created locally. Logger-level filtering is applied. N)rrLrar callHandlers)rr maybe_records r>rz Logger.handles? == {{6*   lI .!F &!r=ct ||jvr|jj|ty#twxYw)z; Add the specified handler to this logger. N)rEr]rRrFrhdlrs r> addHandlerzLogger.addHandlers7  DMM) $$T* NLN )A A ct ||jvr|jj|ty#twxYw)z@ Remove the specified handler from this logger. N)rEr]rVrFr(s r> removeHandlerzLogger.removeHandlers7  t}}$ $$T* NLNr+cp|}d}|r/|jrd} |S|js |S|j}|r/|S)a See if this logger has any handlers configured. Loop through all handlers for this logger and its parents in the logger hierarchy. Return True if a handler was found, else False. Stop searching up the hierarchy whenever a logger with the "propagate" attribute set to zero is found - that will be the last logger which is checked for the existence of handlers. FT)r]rr)rrrfs r> hasHandlerszLogger.hasHandlerssQ  zz  ;; HH r=c|}d}|r_|jD]2}|dz}|j|jk\s"|j|4|jsd}n |j }|r_|dk(rt r4|jt jk\rt j|yytrU|jjs>tjjd|jzd|j_ yyyy)a Pass a record to all relevant handlers. Loop through all handlers for this logger and its parents in the logger hierarchy. If no handler was found, output a one-off error message to sys.stderr. Stop searching up the hierarchy whenever a logger with the "propagate" attribute set to zero is found - that will be the last logger whose handlers are called. rrJNz+No handlers could be found for logger "%s" T)r]rrBrrrr-r.rrrKrrr)rrrfoundr)s r>r%zLogger.callHandlerss   >>TZZ/KK'#;;HH QJ>>Z%5%55%%f-6 )M)M   "-/3yy"9:7; 4*N r=cd|}|r'|jr |jS|j}|r'tS)z Get the effective level for this logger. Loop through this logger and its parents in the logger hierarchy, looking for a non-zero logging level. Return the first one found. )rBrrrs r>getEffectiveLevelzLogger.getEffectiveLevels2||||#]]F r=cB|jry |j|S#t$rwt |jj |k\rdx}|j|<n"||j k\x}|j|<tn#twxYw|cYSwxYw); Is this logger enabled for level 'level'? F)rrrrErrr3rF)rrB is_enableds r>rzLogger.isEnabledFors == ;;u% %  N <<''506;;JU!3!7!7!99JU!3   s'BA B ? B BBBc|j|urdj|j|f}|jj |S)ab Get a logger which is a descendant to this one. This is a convenience method, such that logging.getLogger('abc').getChild('def.ghi') is the same as logging.getLogger('abc.def.ghi') It's useful, for example, when the parent logger is named using __name__ rather than a literal string. rK)rrrrr")rsuffixs r>getChildzLogger.getChilds< 99D XXtyy&12F||%%f--r=cdjj}t tfd|j Dt S#t wxYw)Ncp||jjuryd|jjdzS)NrrJrK)rrrcount)rs r> _hierlevelz&Logger.getChildren.._hierlevel)s1,,,v{{((-- -r=c3K|]B}t|tr0|jur"|d|jzk(r|Dyw)rJN)rarr).0itemr=rs r> z%Logger.getChildren..4sHH $T62t{{d7J!$'1z$++/F+FF sAA )rrrErrrF)rr r=s` @r> getChildrenzLogger.getChildren'sO . LL # # H HH NLNs "A A ct|j}d|jjd|jd|dSr)r!r3rrrrns r>rzLogger.__repr__:s0T3356!%!8!8$))UKKr=ct|j|urddl}|jdt|jffS)Nrzlogger cannot be pickled)r"rpickle PicklingError)rrEs r> __reduce__zLogger.__reduce__>s9 TYY t + &&'AB B499,&&r=)FrJ)NNN)NNFrJ)rrrrrrrzrr$r*r)rrrr r%rrrrr*r-r/r%r3rr9rBrrGr<r=r>rrs $* $ 2 1 4+ 2.2< 5, 2" =F15 LQ4"  ,<< ,.&&L'r=rceZdZdZdZdZy) RootLoggerz A root logger is not that different to any other logger, except that it must have a logging level and there is only one instance of it in the hierarchy. c2tj|d|y)z= Initialize the logger with the name "root". rN)rrrns r>rzRootLogger.__init__Ks fe,r=ctdfSr)r"rs r>rGzRootLogger.__reduce__Qs "}r=N)rrrrrrGr<r=r>rIrIEs - r=rIceZdZdZddZdZdZdZdZdZ d Z d d d Z d Z dZ dZdZdZdZdZedZej*dZedZdZeeZy)rzo An adapter for loggers which makes it easier to specify contextual information in logging output. Nc ||_||_y)ax Initialize the adapter with a logger and a dict-like object which provides contextual information. This constructor signature allows easy stacking of LoggerAdapters, if so desired. You can effectively pass keyword arguments as shown in the following example: adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2")) N)rr)rrrs r>rzLoggerAdapter.__init__\s  r=c(|j|d<||fS)a Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs. Normally, you'll only need to override this one method in a LoggerAdapter subclass for your specific needs. r)r)rrrs r>rzLoggerAdapter.processjs**wF{r=c:|jt|g|i|y)zA Delegate a debug call to the underlying logger. N)r%r rs r>rzLoggerAdapter.debugz -d-f-r=c:|jt|g|i|y)zA Delegate an info call to the underlying logger. N)r%rrs r>r$zLoggerAdapter.infos s,T,V,r=c:|jt|g|i|y)zC Delegate a warning call to the underlying logger. N)r%rrs r>r*zLoggerAdapter.warnings #///r=cftjdtd|j|g|i|yrrrs r>r)zLoggerAdapter.warnrr=c:|jt|g|i|y)zB Delegate an error call to the underlying logger. Nr%r rs r>rzLoggerAdapter.errorrPr=Trc>|jt|g|d|i|y)zF Delegate an exception call to the underlying logger. rNrUr s r>rzLoggerAdapter.exceptions# @d@X@@r=c:|jt|g|i|y)zD Delegate a critical call to the underlying logger. N)r%rrs r>rzLoggerAdapter.criticals 3000r=c|j|r7|j||\}}|jj||g|i|yy)z Delegate a log call to the underlying logger, after adding contextual information from this adapter instance. N)rrrr%rs r>r%zLoggerAdapter.logsI   U #,,sF3KC DKKOOE3 8 8 8 $r=c8|jj|S)r5)rrrns r>rzLoggerAdapter.isEnabledFors{{''..r=c:|jj|y)zC Set the specified level on the underlying logger. N)rrzrns r>rzzLoggerAdapter.setLevels U#r=c6|jjS)zD Get the effective level for the underlying logger. )rr3rs r>r3zLoggerAdapter.getEffectiveLevels{{,,..r=c6|jjS)z@ See if the underlying logger has any handlers. )rr/rs r>r/zLoggerAdapter.hasHandlerss{{&&((r=c @|jj|||fi|S)zX Low-level log implementation, proxied to allow nested logger adapters. )rrrs r>rzLoggerAdapter._logs$ t{{sD;F;;r=c.|jjSr9rrrs r>rzLoggerAdapter.managers{{"""r=c&||j_yr9r_rs r>rzLoggerAdapter.managers# r=c.|jjSr9)rrrs r>rzLoggerAdapter.names{{r=c|j}t|j}d|jjd|j d|dSr)rr!r3rrr)rrrBs r>rzLoggerAdapter.__repr__s9V5578!%!8!8&++uMMr=r9)rrrrrrrr$r*r)rrrr%rrzr3r/rrrrrrrrrr<r=r>rrVs   . - 0 + . .2A 1 9/ $ / ) < ## ^^$$  N $L1r=rc t |jdd}|jdd}|jdd}|r=tjddD]'}tj ||j )t tjdk(r|jdd}|d |vr"d |vrtd d |vsd |vr td |r|jd d}|jd d}|r,d|vrd}ntj|}t||||}n|jd d}t|}|g}|jdd} |jdd} | tvr/tddjtjz|jdt| d} t| | | } |D]4}|j |j#| tj%|6|jdd} | tj'| |r-dj|j}td|zt)y#t)wxYw)a8 Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured, unless the keyword argument *force* is set to ``True``. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT format string, and add the handler to the root logger. A number of optional keyword arguments may be specified, which can alter the default behaviour. filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler. filemode Specifies the mode to open the file, if filename is specified (if filemode is unspecified, it defaults to 'a'). format Use the specified format string for the handler. datefmt Use the specified date/time format. style If a format string is specified, use this to specify the type of format string (possible values '%', '{', '$', for %-formatting, :meth:`str.format` and :class:`string.Template` - defaults to '%'). level Set the root logger level to the specified level. stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with 'filename' - if both are present, 'stream' is ignored. handlers If specified, this should be an iterable of already created handlers, which will be added to the root logger. Any handler in the list which does not have a formatter assigned will be assigned the formatter created in this function. force If this keyword is specified as true, any existing handlers attached to the root logger are removed and closed, before carrying out the configuration as specified by the other arguments. encoding If specified together with a filename, this encoding is passed to the created FileHandler, causing it to be used when the file is opened. errors If specified together with a filename, this value is passed to the created FileHandler, causing it to be used when the file is opened in text mode. If not specified, the default value is `backslashreplace`. Note that you could specify a stream created using open(filename, mode) rather than passing the filename and mode in. However, it should be remembered that StreamHandler does not close its stream (since it may be using sys.stdout or sys.stderr), whereas FileHandler closes its stream when the handler is closed. .. versionchanged:: 3.2 Added the ``style`` parameter. .. versionchanged:: 3.3 Added the ``handlers`` parameter. A ``ValueError`` is now thrown for incompatible arguments (e.g. ``handlers`` specified together with ``filename``/``filemode``, or ``filename``/``filemode`` specified together with ``stream``, or ``handlers`` specified together with ``stream``. .. versionchanged:: 3.8 Added the ``force`` parameter. .. versionchanged:: 3.9 Added the ``encoding`` and ``errors`` parameters. forceFrNrbackslashreplacerr]rr^z8'stream' and 'filename' should not be specified togetherzG'stream' or 'filename' should not be specified together with 'handlers'filemoderrrrrrrrrrJrBrzUnrecognised argument(s): %s)rEpoprr]r-r+rrdr&rr rrrrrrkrr*rzrF)rrdrrhr]r^rrdfsrfsrrBrs r>rrsTLN2 7E*::j$/H&89 ]]1%""1% & t}}  "zz*d3Hv%**>$&:;;v%v)=$&JKK!::j$7zz*c2d{!%#%#3#3H#=#Hd-5fFA$ZZ$7F%f-A3**Y-CJJw,EG# !;chh!(?1"122HgenQ&78BBU+C;;&NN3'"JJw-E  e$yy/ !?$!FGG s II,, I8c|r#t|tr|tjk(rtStj j |S)z Return a logger with the specified name, creating it if necessary. If no name is specified, return the root logger. )rarcrrrrr"res r>r"r"es5 :dC(TTYY-> >> # #D ))r=cttjdk(r ttj|g|i|y)z Log a message with severity 'CRITICAL' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format. rN)rrr]rrrrrs r>rros0  4==Q MM#'''r=c"t|g|i|y)z: Don't use this function, use critical() instead. Nrrms r>r r ys S"4"6"r=cttjdk(r ttj|g|i|y)z Log a message with severity 'ERROR' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format. rN)rrr]rrrms r>rr0  4==Q JJs$T$V$r=rc&t|g|d|i|y)z Log a message with severity 'ERROR' on the root logger, with exception information. If the logger has no handlers, basicConfig() is called to add a console handler with a pre-defined format. rNr )rrrrs r>rrs  #22x262r=cttjdk(r ttj|g|i|y)z Log a message with severity 'WARNING' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format. rN)rrr]rr*rms r>r*r*s0  4==Q LL&t&v&r=cXtjdtdt|g|i|y)Nz8The 'warn' function is deprecated, use 'warning' insteadr#rrms r>r)r)s* MM !3Q8 C!$!&!r=cttjdk(r ttj|g|i|y)z Log a message with severity 'INFO' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format. rN)rrr]rr$rms r>r$r$s0  4==Q IIc#D#F#r=cttjdk(r ttj|g|i|y)z Log a message with severity 'DEBUG' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format. rN)rrr]rrrms r>rrrpr=cttjdk(r ttj||g|i|y)z Log 'msg % args' with the integer severity 'level' on the root logger. If the logger has no handlers, call basicConfig() to add a console handler with a pre-defined format. rN)rrr]rr%)rBrrrs r>r%r%s2  4==Q HHUC)$)&)r=cj|tj_tjjy)zB Disable all logging calls of severity 'level' and below. N)rrrr)rBs r>rrs !DLLLLr=cJt|ddD]Z} |}|rN |jt|ddr|j|j |j\y#t t f$rY$wxYw#|jwxYw#trYxYw)z Perform any cleanup actions in the logging system (e.g. flushing buffers). Should be called at application exit. N flushOnCloseT) reversedrjrrr+rrdrlr.) handlerListr\rhs r>r(r(s{1~& A IIKq.$7 GGIIIK+' ,  IIK s: B=A-B-A?<B>A??BBB B"c(eZdZdZdZdZdZdZy)ra This handler does nothing. It's intended to be used to avoid the "No handlers could be found for logger XXX" one-off warning. This is important for library code, which may contain code to log events. If a user of the library does not configure logging, the one-off warning might be produced; to avoid this, the library developer simply needs to instantiate a NullHandler and add it to the top-level logger of the library module or package. cyzStub.Nr<r2s r>rzNullHandler.handler=cyr~r<r2s r>r~zNullHandler.emitrr=cd|_yr9)rtrs r>rmzNullHandler.createLocks  r=cyr9r<rs r>rwzNullHandler._at_fork_reinit rrr=N)rrrrrr~rmrwr<r=r>rrs r=rc|tt||||||yytj|||||}td}|js|j t |jt|y)a Implementation of showwarnings which redirects to logging, which will first check to see if the file parameter is None. If a file is specified, it will delegate to the original warnings implementation of showwarning. Otherwise, it will call warnings.formatwarning and will log the resulting string to a warnings logger named "py.warnings" with level logging.WARNING. Nz py.warnings) _warnings_showwarningr formatwarningr"r]r*rr*rc)r7categoryr^rrliner rs r> _showwarningr st  , !'8XvtT R -  " "7Hh M=)   km , s1vr=c|r't tjatt_yyttt_dayy)z If capture is true, redirect all warnings to the logging package. If capture is False, ensure that warnings are not redirected to logging but to their original destinations. N)rr showwarningr)captures r>rr sA ($,$8$8 !#/H  ) ! ,#8H $( ! -r=r9r)vrrKrWrr&rr(rr`collections.abcrtypesrstringrr StrFormatter__all__r __author__ __status__ __version____date__rr.rrrrrr r rrrr rr@r:r/r!rrrSrXrY__code__r[r\r_rgrsrirErFrqWeakSetrtrzrmobjectrrr,r+r&rrrrrrr=rr rNWeakValueDictionaryrdr[r^rbr0r1rrr r_defaultLastResortr-rr'r#rrrIrrrrrr"rr rrr*r)r$rr%rr(atexitregisterrrrrr<r=r>rs"LKKKK, 26    TYY[            j 7 Y& 7 H         6  3 +L5& 77  L11== > 0  r%& $37??#4  B|'H(46kk`  M6MB:\:D ., .F4   % 8 9 @ A  nnfK$$T#/V#/J;v;B (G ' ' )  $D>hD>LR2GR2jRT-RTj]"$G,  +&+.  {f{Bx'Xx'v   E2FE2N' % y@*(# %$(3'" $%* &F ' 0()r=usr/lib64/python3.12/re/__pycache__/__init__.cpython-312.pyc000064400000043014152352515300017205 0ustar00 ֦i?dZddlZddlmZmZddlZddlZgdZdZejejejejGdd Z ejZd d Zd d Zd d Zd!d Zd!dZd!dZd dZd dZd dZdZd dZdDcic]}|de|zc}ZdZeej.ddZeej.ddjdZiZ iZ!dZ"dZ#e#e"ksJdZ$ejJe"dZ&ddl'Z'dZ(e'jRee(e$GddZ*ycc}w)"aSupport for regular expressions (RE). This module provides regular expression matching operations similar to those found in Perl. It supports both 8-bit and Unicode strings; both the pattern and the strings being processed can contain null bytes and characters outside the US ASCII range. Regular expressions can contain both special and ordinary characters. Most ordinary characters, like "A", "a", or "0", are the simplest regular expressions; they simply match themselves. You can concatenate ordinary characters, so last matches the string 'last'. The special characters are: "." Matches any character except a newline. "^" Matches the start of the string. "$" Matches the end of the string or just before the newline at the end of the string. "*" Matches 0 or more (greedy) repetitions of the preceding RE. Greedy means that it will match as many repetitions as possible. "+" Matches 1 or more (greedy) repetitions of the preceding RE. "?" Matches 0 or 1 (greedy) of the preceding RE. *?,+?,?? Non-greedy versions of the previous three special characters. {m,n} Matches from m to n repetitions of the preceding RE. {m,n}? Non-greedy version of the above. "\\" Either escapes special characters or signals a special sequence. [] Indicates a set of characters. A "^" as the first character indicates a complementing set. "|" A|B, creates an RE that will match either A or B. (...) Matches the RE inside the parentheses. The contents can be retrieved or matched later in the string. (?aiLmsux) The letters set the corresponding flags defined below. (?:...) Non-grouping version of regular parentheses. (?P...) The substring matched by the group is accessible by name. (?P=name) Matches the text matched earlier by the group named name. (?#...) A comment; ignored. (?=...) Matches if ... matches next, but doesn't consume the string. (?!...) Matches if ... doesn't match next. (?<=...) Matches if preceded by ... (must be fixed length). (?rr?s r<rrs GU # - -f 55r;c8t||j|S)ztScan through string looking for a match to the pattern, returning a Match object, or None if no match was found.)r>rr?s r<rrs GU # * *6 22r;c<t||j|||S)aZReturn the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl. repl can be either a string or a callable; if a string, backslash escapes in it are processed. If it is a callable, it's passed the Match object and must return a replacement string to be used.)r>r r@replrAcountrBs r<r r s  GU # ' 'fe <r rFs r<r r s  GU # ( (vu ==r;c:t||j||S)aSplit the source string by the occurrences of the pattern, returning a list containing the resulting substrings. If capturing parentheses are used in pattern, then the text of all groups in the pattern are also returned as part of the resulting list. If maxsplit is nonzero, at most maxsplit splits occur, and the remainder of the string is returned as the final element of the list.)r>r )r@rAmaxsplitrBs r<r r s GU # ) )&( ;;r;c8t||j|S)aReturn a list of all non-overlapping matches in the string. If one or more capturing groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result.)r>r r?s r<r r s GU # + +F 33r;c8t||j|S)zReturn an iterator over all non-overlapping matches in the string. For each match, the iterator returns a Match object. Empty matches are included in the result.)r>r r?s r<r r s GU # , ,V 44r;ct||S)zACompile a regular expression pattern, returning a Pattern object.)r>)r@rBs r<rrs GU ##r;c|tjtjtj y)z#Clear the regular expression cachesN)_cacheclear_cache2_compile_template cache_clearr:r;r<rrs  LLN MMO!!#r;cddl}|jdt|j5|j dtt ||t zcdddS#1swYyxYw)zBCompile a template pattern, returning a Pattern object, deprecatedrNzThe re.template() function is deprecated as it is an undocumented function without an obvious purpose. Use re.compile() instead.ignore)warningswarnDeprecationWarningcatch_warnings simplefilterr>r3)r@rBrWs r<rrsT MM.% &  "h(:;q) # " "s )AA's()[]{}?*+-|^$\.&~# \ct|tr|jtSt|d}|jtj dS)z0 Escape special characters in a string. latin1) isinstancestr translate_special_chars_mapencode)r@s r<rrsI'3  !344gx(  !34;;HEEr;ic:t|tr |j} tt |||fS#t $rYnwxYwt |||f}t j|d}|t|tr|r td|Stj|s td|tzrddl}|jdt tj"||}|t$zr|St't t(k\r9 t t+t-t =n#t.t0t f$rYnwxYw|t |<t'tt2k\r9 tt+t-t=n#t.t0t f$rYnwxYw|t|<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled patternrzoThe re.TEMPLATE/re.T flag is deprecated as it is an undocumented flag without an obvious purpose. Don't use it.)r_r$valuerRtypeKeyErrorrPpopr ValueErrorrisstring TypeErrorr3rWrXrYrr5len _MAXCACHEnextiter StopIteration RuntimeError _MAXCACHE2)r@rBkeyprWs r<r>r>sv%#  tG}gu455     ='5 )C 3Ay gw ' KMMN!!'*OP P 19  MM$'  (   gu - 5=H v;) #  4V -.!<:  F3K 7|z! T']+,|X6   GCL Hs03 ??D D76D7E88FFcVtj|tj||SN)_srerrparse_template)r@rGs r<rSrSKs" =='"8"8w"G HHr;c>t|j|jffSrx)r>r@rB)rvs r<_pickler|Ts aii) ))r;ceZdZddZdZy)Scannercddlm}m}t|tr |j }||_g}tj}||_ |D]j\}}|j} |jtj||| ddtj||ffg|j| |dltj||d|ffg}tj ||_y)Nr)BRANCH SUBPATTERNr) _constantsrrr_r$rglexiconrStaterB opengroupappend SubPatternparse closegrouprrscanner) selfrrBrrrvsphraseactiongids r<__init__zScanner.__init__]s2 eY 'KKE  MMO%NFF++-C HHW''c1avu)EFG,  LLae $ &   qFT1I#6"7 8 ((+ r;cfg}|j}|jj|j}d} |}|snk|j}||k(rnU|j|j dz d}t |r||_|||j}||||}u|||dfS)Nrr)rrrendr lastindexcallablegroup) rrAresultrrimjrs r<scanz Scanner.scanns $$V,22 AAAv\\!++a-03F aggi0!vAvabz!!r;Nr)r'r(r)rrr:r;r<r~r~\s ,""r;r~r)rr)+__doc__enumrdrr functoolsry__all__ __version__ global_enum _simple_enumIntFlagKEEPr$rrrrr r r r r rrrchrrbrrhrrrPrRrortr> lru_cacherScopyregr|pickler~)rs0r<rs"iV    4<<$))4  5   2 6 3 = ><45$$ *"1RR0Q1aA&0QRF  y  Q' ( Y  r1 % + +B /0     I1 fYI I *w* %"%"SsElib64/python3.12/http/__pycache__/__init__.cpython-312.pyc000064400000022421152360123450016744 0ustar00 ֦it tddlmZmZmZddgZeeGddZeeGddZy))StrEnumIntEnum _simple_enum HTTPStatus HTTPMethodc`eZdZdZdGdZedZedZedZedZ edZ dZ d Z d Z d Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"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-Z0d.Z1d/Z2d0Z3d1Z4d2Z5d3Z6d4Z7d5Z8d6Z9d7Z:d8Z;d9ZdZAd?ZBd@ZCdAZDdBZEdCZFdDZGdEZHyF)HraGHTTP 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) * RFC 2324: Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0) * RFC 8297: An HTTP Status Code for Indicating Hints * RFC 8470: Using Early Data in HTTP c\tj||}||_||_||_|SN)int__new___value_phrase description)clsvaluerrobjs &/usr/lib64/python3.12/http/__init__.pyr zHTTPStatus.__new__s,kk#u%  % c"d|cxkxrdkScS)Ndselfs ris_informationalzHTTPStatus.is_informational"d!c!!!!rc"d|cxkxrdkScS)Ni+rrs r is_successzHTTPStatus.is_success&rrc"d|cxkxrdkScS)N,irrs ris_redirectionzHTTPStatus.is_redirection*rrc"d|cxkxrdkScS)Nirrs ris_client_errorzHTTPStatus.is_client_error.rrc"d|cxkxrdkScS)NiWrrs ris_server_errorzHTTPStatus.is_server_error2rr)rContinuez!Request received, please continue)ezSwitching Protocolsz.Switching to new protocol; obey Upgrade header)f Processing)gz Early Hints)rOKz#Request fulfilled, document follows)CreatedzDocument created, URL follows)Acceptedz/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)r!zMultiple Choicesz,Object has several resources -- see URI list)i-zMoved Permanently(Object moved permanently -- see URI list)i.Found(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:)r$z Bad Requestz(Bad request syntax or unsupported method)i Unauthorizedz*No permission -- see authorization schemes)izPayment Requiredz"No payment -- see charging schemes)i 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)iConflictzRequest conflict)iGonez5URI 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)iz I'm a Teapotz5Server refuses to brew coffee because it is a teapot.)izMisdirected Requestz(Server is not able to produce a response)izUnprocessable Entity)iLocked)izFailed Dependency)iz Too Early)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)r'zInternal 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))I__name__ __module__ __qualname____doc__r propertyrrr"r%r(CONTINUESWITCHING_PROTOCOLS PROCESSING EARLY_HINTSr.CREATEDACCEPTEDNON_AUTHORITATIVE_INFORMATION NO_CONTENT RESET_CONTENTPARTIAL_CONTENT MULTI_STATUSALREADY_REPORTEDIM_USEDMULTIPLE_CHOICESMOVED_PERMANENTLYFOUND SEE_OTHER NOT_MODIFIED USE_PROXYTEMPORARY_REDIRECTPERMANENT_REDIRECT BAD_REQUEST UNAUTHORIZEDPAYMENT_REQUIRED FORBIDDEN NOT_FOUNDMETHOD_NOT_ALLOWEDNOT_ACCEPTABLEPROXY_AUTHENTICATION_REQUIREDREQUEST_TIMEOUTCONFLICTGONELENGTH_REQUIREDPRECONDITION_FAILEDREQUEST_ENTITY_TOO_LARGEREQUEST_URI_TOO_LONGUNSUPPORTED_MEDIA_TYPEREQUESTED_RANGE_NOT_SATISFIABLEEXPECTATION_FAILED IM_A_TEAPOTMISDIRECTED_REQUESTUNPROCESSABLE_ENTITYLOCKEDFAILED_DEPENDENCY TOO_EARLYUPGRADE_REQUIREDPRECONDITION_REQUIREDTOO_MANY_REQUESTSREQUEST_HEADER_FIELDS_TOO_LARGEUNAVAILABLE_FOR_LEGAL_REASONSINTERNAL_SERVER_ERRORNOT_IMPLEMENTED BAD_GATEWAYSERVICE_UNAVAILABLEGATEWAY_TIMEOUTHTTP_VERSION_NOT_SUPPORTEDVARIANT_ALSO_NEGOTIATESINSUFFICIENT_STORAGE LOOP_DETECTED NOT_EXTENDEDNETWORK_AUTHENTICATION_REQUIREDrrrrrs $""""""""""DH>"J$K :B=G;H%I!HJNMGO&L.G84 DEKI5LLI444K6L.) __class__rC_name_rs r__repr__zHTTPMethod.__repr__s NN33T[[AAr)CONNECTz%Establish a connection to the server.)DELETEzRemove the target.)GETzRetrieve the target.)HEADzBSame as GET, but only retrieve the status line and header section.)OPTIONSz2Describe the communication options for the target.)PATCHz(Apply partial modifications to a target.)POSTzPerform a message loop-back test along the path to the target.N)rCrDrErFr rrrrrrrrrrrrrrrsB BAG +F 'C WDMG ?E QD ?C UErN)enumrrr__all__rrrrrrs[//  &gdCdCdCNgVVVrlib64/python3.12/html/__pycache__/__init__.cpython-312.pyc000064400000010437152360460130016734 0ustar00 ֦i8dZddlZddlmZddgZdNdZidddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'id(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIZhdJZ dKZ ejdLZ dMZ y)Oz* General functions for HTML manipulation. N)html5escapeunescapec|jdd}|jdd}|jdd}|r$|jdd}|jd 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)squotes &/usr/lib64/python3.12/html/__init__.pyrr s\ #wA #vA #vA IIc8 $ IIdH % H�  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Ÿ>~   rrrrrrrrrrrr r!r"r$r%r'r)r*r+r,r-r.r/r0r1r2r3r4r5r7r8c|jd}|ddk(r{|ddvrt|ddjdd}nt|ddjd}|tvr t|Sd|cxkrd ksn|d kDry |tvry t |S|t vr t |Stt|dz dd D]!}|d|t vst |d|||dzcSd|zS)Nrzr#xXr{;riirrr) groupintrstrip_invalid_charrefs_invalid_codepointschr_html5rangelen)r numxs r_replace_charrefr[s  Ats{ Q44<aell3',Caell3'(C # #$S) ) S "F "cHn % %3x ;!9 s1vaxB'A!uae}qu,,(7Nrz7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)cBd|vr|Stjt|S)a^ Convert all named and numeric character references (e.g. >, >, &x3e;) in the string s to the corresponding unicode characters. This function uses the rules defined by the HTML 5 standard for both valid and invalid character references, and the list of HTML 5 named character references defined in html.entities.html5. r)_charrefsubr)r s rrrzs" !| <<(! ,,r)T)__doc__re_re html.entitiesrr__all__rrrrcompilerrrrrs) Z   $#(#$# (# & #  ( #  ( # (# (# (# (# (# (# (# (# (#  &!#" (##$ &%#& &'#( ()#* (+#, (-#. (/#0 (1#2 (3#4 (5#6 (7#8 (9#: (;#< (=#> (?#@ &A#B (C#D (E#J06 3;;3 4 -rlib64/python3.12/xml/dom/__pycache__/__init__.cpython-312.pyc000064400000014062152360471640017355 0ustar00 ֦i dZGddZdZdZdZdZdZdZd Zd Z d Z d Z d Z dZ dZdZdZdZGddeZGddeZGddeZGddeZGddeZGddeZGdd eZGd!d"eZGd#d$eZGd%d&eZGd'd(eZGd)d*eZGd+d,eZGd-d.eZ Gd/d0eZ!Gd1d2eZ"Gd3d4eZ#Gd5d6Z$d7Z%d8Z&d9Z'd:Z(d:Z)dd;l*m+Z+m,Z,y:)>\ )BD D4-$-"-r"c|jS)N)code)r/s r# _get_codezDOMException._get_codeHs yyr"N)rrrrr.r4rr"r#r)r)>sI. r"r)ceZdZeZy) IndexSizeErrN)rrrINDEX_SIZE_ERRr3rr"r#r6r6L Dr"r6ceZdZeZy)DomstringSizeErrN)rrrDOMSTRING_SIZE_ERRr3rr"r#r:r:O Dr"r:ceZdZeZy)HierarchyRequestErrN)rrrHIERARCHY_REQUEST_ERRr3rr"r#r>r>R Dr"r>ceZdZeZy)WrongDocumentErrN)rrrWRONG_DOCUMENT_ERRr3rr"r#rBrBUr<r"rBceZdZeZy)InvalidCharacterErrN)rrrINVALID_CHARACTER_ERRr3rr"r#rErEXr@r"rEceZdZeZy)NoDataAllowedErrN)rrrNO_DATA_ALLOWED_ERRr3rr"r#rHrH[ Dr"rHceZdZeZy)NoModificationAllowedErrN)rrrNO_MODIFICATION_ALLOWED_ERRr3rr"r#rLrL^s &Dr"rLceZdZeZy) NotFoundErrN)rrr NOT_FOUND_ERRr3rr"r#rOrOa Dr"rOceZdZeZy)NotSupportedErrN)rrrNOT_SUPPORTED_ERRr3rr"r#rSrSd Dr"rSceZdZeZy)InuseAttributeErrN)rrrINUSE_ATTRIBUTE_ERRr3rr"r#rWrWgrJr"rWceZdZeZy)InvalidStateErrN)rrrINVALID_STATE_ERRr3rr"r#rZrZjrUr"rZceZdZeZy) SyntaxErrN)rrr SYNTAX_ERRr3rr"r#r]r]ms Dr"r]ceZdZeZy)InvalidModificationErrN)rrrINVALID_MODIFICATION_ERRr3rr"r#r`r`ps #Dr"r`ceZdZeZy) NamespaceErrN)rrr NAMESPACE_ERRr3rr"r#rcrcsrQr"rcceZdZeZy)InvalidAccessErrN)rrrINVALID_ACCESS_ERRr3rr"r#rfrfvr<r"rfceZdZeZy) ValidationErrN)rrrVALIDATION_ERRr3rr"r#ririyr8r"ric eZdZdZdZdZdZdZy)UserDataHandlerzBClass giving the operation constants for UserDataHandler.handle().rrrrN)rrrr NODE_CLONED NODE_IMPORTED NODE_DELETED NODE_RENAMEDrr"r#rlrl|sLKMLLr"rlz$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/2000/xmlns/zhttp://www.w3.org/1999/xhtmlN)getDOMImplementationregisterDOMImplementation)-rrr7r;r?rCrFrIrMrPrTrXr[r^rardrgrjr-r)r6r:r>rBrErHrLrOrSrWrZr]r`rcrfrirl XML_NAMESPACEXMLNS_NAMESPACEXHTML_NAMESPACEEMPTY_NAMESPACE EMPTY_PREFIXdomregrqrrrr"r#rysh"%%4"#!"!"!"!"!"!"!" !"!#!#!# !#!# !#!# 9 <|!,!|!,!|'|',l l $\$<|L7 10 CCr"usr/lib64/python3.12/ctypes/__pycache__/__init__.cpython-312.pyc000064400000055656152361253210020124 0ustar00 ֦i"Gd dZddlZddlZddlZdZddlm Z m Z m Z ddlm Z ddlm ZddlmZddlmZmZdd lmZdd lmZdd lmZeek7r ed eeej0d k(rddlmZeZej0dk(rGej6dk(r8eej:j<j?dddkreZddlm Z!m"Z#m$Z%m&Z'dpdZ(e(Z)iZ*dZ+ej0d k(r?ddlm,Z-ddlm.Z/iZ0dZ1e1jr7e+jjedde1_nej0dk(rddlm3Z-ddlm4Z4m5Z5m6Z6m7Z7m8Z8ddlm9Z9m:Z:ddlm;Z;dpdZ<Gd d!e;Z=eeGd%d&e;Z?ed?e;ZLeLxeL_JeL_KeeBe@eGfD],Ze4edak(reZe4ednk(reZe4edk(s+eZ.e?eCeAeHfD],Ze4edak(reZe4ednk(reZe4edk(s+eZ.[edk(reZnednk(reZn edoeeWy#e$rYwxYw)sz,create and manipulate C data types in PythonNz1.1.0)Union StructureArray)_Pointer)CFuncPtr) __version__) RTLD_LOCAL RTLD_GLOBAL) ArgumentError) SIZEOF_TIME_TcalcsizezVersion number mismatchnt) FormatErrorposixdarwin.)FUNCFLAG_CDECLFUNCFLAG_PYTHONAPIFUNCFLAG_USE_ERRNOFUNCFLAG_USE_LASTERRORc*t|tr@|t|dz}tjd||t |z}|}||_|St|tr)tjdd|t |z}|}|St|)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 TypeErrorinitsizebuftypebufs (/usr/lib64/python3.12/ctypes/__init__.pycreate_string_bufferr*1s $ <t9Q;D 0$=4-i  D#  0$=4-i D/c6t|jddr tz|jddr tz|rt d|j z t fS#t$rYnwxYwGfddt}|t f<|S)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) %sc eZdZWZWZWZy) CFUNCTYPE..CFunctionTypeN__name__ __module__ __qualname__ _argtypes_ _restype__flags_argtypesflagsrestypesr) CFunctionTyper1fs  r+r=) _FUNCFLAG_CDECLpop_FUNCFLAG_USE_ERRNO_FUNCFLAG_USE_LASTERROR ValueErrorkeys_c_functype_cacheKeyError _CFuncPtr)r<r:kwr=r;s`` @r) CFUNCTYPErHIs E vvk5! $$ vv& (( .WinFunctionTypeNr2r9sr)WinFunctionTyperNs!JIGr+rO) _FUNCFLAG_STDCALLr?r@rArBrC_win_functype_cacherErF)r<r:rGrOr;s`` @r) WINFUNCTYPErRrs! 66+u % ( (E 66"E * , ,E @2779LM M &5'AB B     i ;JWh67rIrHrR)dlopen)sizeofbyref addressof alignmentresize) get_errno set_errno) _SimpleCDatac~ddlm}| |j}t|||}}||k7rt d|||fzy)Nrr z"sizeof(%s) wrong: %d instead of %d)structr_type_rT SystemError)typtypecoderactualrequireds r) _check_sizerdsT ::c{HX$6HF >123 3r+c"eZdZdZfdZxZS) py_objectOcp t|S#t$rdt|jzcYSwxYw)Nz %s())super__repr__rBtyper3)self __class__s r)rjzpy_object.__repr__s: 67#% % 6$t*"5"55 5 6s !55)r3r4r5r^rj __classcell__)rms@r)rfrfs F66r+rfPceZdZdZy)c_shorthNr3r4r5r^r+r)rqrq Fr+rqceZdZdZy)c_ushortHNrsrtr+r)rwrwrur+rwceZdZdZy)c_longlNrsrtr+r)rzrzrur+rzceZdZdZy)c_ulongLNrsrtr+r)r}r}rur+r}ir{ceZdZdZy)c_intrNrsrtr+r)rrr+rceZdZdZy)c_uintINrsrtr+r)rrrr+rceZdZdZy)c_floatfNrsrtr+r)rrrur+rceZdZdZy)c_doubledNrsrtr+r)rrrur+rceZdZdZy) c_longdoublegNrsrtr+r)rrrur+rqceZdZdZy) c_longlongrNrsrtr+r)rrrr+rceZdZdZy) c_ulonglongQNrsrtr+r)rrrr+rceZdZdZy)c_ubyteBNrsrtr+r)rrrur+rceZdZdZy)c_bytebNrsrtr+r)rrrur+rceZdZdZy)r cNrsrtr+r)r r rur+r ceZdZdZdZy)c_char_pzct|jjdtj|jdSN()rmr3c_void_p from_bufferr!rls r)rjzc_char_p.__repr__(>>22H4H4H4N4T4TUUr+Nr3r4r5r^rjrtr+r)rr FVr+rceZdZdZy)rroNrsrtr+r)rrrur+rceZdZdZy)c_bool?Nrsrtr+r)rrrur+r)POINTERpointer_pointer_type_cacheceZdZdZdZy) c_wchar_pZct|jjdtj|jdSrrrs r)rjzc_wchar_p.__repr__rr+Nrrtr+r)rrrr+rceZdZdZy)c_wcharuNrsrtr+r)rrrur+rcDtjtjtjdk(rt jt jtt_tjtt_ttd<y)Nr) rclearrD_osnamerQr from_paramrrrr rrtr+r) _reset_cacher sb xx4!!#"+"6"6GG!)!4!4GFO (r+czt|trh|6ttdk(rt d|Ddz}nt |dz}t jd||t|z}|}||_|St|tr)t jdd|t|z}|}|St|)zcreate_unicode_buffer(aString) -> character array create_unicode_buffer(anInteger) -> character array create_unicode_buffer(aString, anInteger) -> character array Nc3@K|]}t|dkDrdndyw)irrN)ord).0rs r) z(create_unicode_buffer..s E1A1Q6srzctypes.create_unicode_buffer) rstrrTrsumrrrr!r"r#r$s r)create_unicode_bufferrs $ <g!#EEEI4y1} 14>D.i  D#  14>D.i D/r+ctj|d tdt|tvr td|j||t|<tt|=y)Nz%This type already exists in the cachezWhat's this???)rget RuntimeErroridset_type)rclss r)SetPointerTyper2sasD)5BCC '{--+,,GS&BwK(r+c ||zSNrt)r`rs r)ARRAYr<s 9r+cHeZdZdZeZeZdZdZ dZ e ddddfdZ dZ dZd Zy) 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. zrNFcx |rtj|}|_j |r tz |r t z t jjdr< |r9|jdr(d|vr$|tjtjzz}tjdk(rL||}nGddl }|j}d|vsd|vr/|jj_||j z}G fdd t"}|_|t'j|_y|_y) Naixrz.a(rr/\c.eZdZWZWjZy)CDLL.__init__.._FuncPtrN)r3r4r5r8_func_restype_r7)r;rlsr)_FuncPtrrusG++Ir+r)rfspath_name _func_flags_r@rArplatform startswithendswith RTLD_MEMBERRTLD_NOWrr!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRS_getfullpathname!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRrFr_dlopen_handle) rlrmodehandler-r.winmoderrr;s ` @r)__init__z CDLL.__init__Ws ::d#D !!  ( (E  , ,E == # #E *   c*u}#//CLL8: 88t ";;$;$$,!#!4!4TZZ!@DJB@@@D ,y ,! >"4::t4DL!DLr+cd|jj|j|jtj dzdzzt |tj dzdzzfzS)Nz<%s '%s', handle %x at %#x>rr)rmr3rrrmaxsizerrs r)rjz CDLL.__repr__sY,''a!!344DLLNQ./11 1r+c|jdr|jdr t||j|}t ||||S)N__)rrAttributeError __getitem__setattr)rlrfuncs r) __getattr__zCDLL.__getattr__sE ??4 T]]4%8 & &%dD! r+cZ|j||f}t|ts||_|Sr)rrr"r3)rlname_or_ordinalrs r)rzCDLL.__getitem__s+}}ot45/3/+DM r+)r3r4r5__doc__r>rrrrrr DEFAULT_MODErrjrrrtr+r)rrBsE #LN EGH".t %&"P1 r+rceZdZdZeezZy)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)r3r4r5rr>_FUNCFLAG_PYTHONAPIrrtr+r)rrs#%88Lr+rceZdZdZeZy)WinDLLznThis class represents a dll exporting functions using the Windows stdcall calling convention. N)r3r4r5rrPrrtr+r)rrs ) r+r)_check_HRESULTr[ceZdZdZeZy)HRESULTr{N)r3r4r5r^r_check_retval_rtr+r)rrs(r+rceZdZdZeZeZy)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)r3r4r5rrPrrrrtr+r)rrs )  r+rcHeZdZdZdZdZdZeejZ y) LibraryLoaderc||_yr_dlltype)rldlltypes r)rzLibraryLoader.__init__s  r+c|ddk(r t| |j|}t||||S#t$r t|wxYw)Nr_)rr OSErrorr)rlrdlls r)rzLibraryLoader.__getattr__sZ 7c> & & '--%C dC   ' & & 's 5A ct||Sr)getattrrlrs r)rzLibraryLoader.__getitem__stT""r+c$|j|Srrrs r)rJzLibraryLoader.LoadLibrarys}}T""r+N) r3r4r5rrrrJ classmethod_types GenericAlias__class_getitem__rtr+r)rrs) ##$F$7$78r+rz python dllcygwinzlibpython%d.%d.dllr)get_last_errorset_last_errorcl| t}|t|j}td|d|Sr) GetLastErrorrstripr )codedescrs r)WinErrorrs7 <>D =%++-EtUD$//r+) _memmove_addr _memset_addr_string_at_addr _cast_addrc.Gfddt}|S)Nc$eZdZWZWZeezZy)!PYFUNCTYPE..CFunctionTypeN)r3r4r5r6r7r>rr8)r:r<sr)r=r&s  !$77r+r=)rF)r<r:r=s`` r) PYFUNCTYPEr's8 8 r+ct|||Sr)_cast)objr`s r)castr+s c3 r+ct||S)zJstring_at(ptr[, size]) -> string Return the byte string at void *ptr.) _string_atptrr&s r) string_atr0 s c4  r+)_wstring_at_addrct||S)zYwstring_at(ptr[, size]) -> string Return the wide-character string at void *ptr.) _wstring_atr.s r) wstring_atr4s3%%r+c tdttdg}|j|||S#t$rYywxYw)Ncomtypes.server.inprocserver*i) __import__globalslocalsDllGetClassObject ImportError)rclsidriidppvccoms r)r;r;sK =rrrr@rrAr*c_bufferrDrHrJrrKrPrQrRreplacerSrTrUrVrWrXrYrZr[rdrfrqrwrzr}rrrrrrrr __ctype_le__ __ctype_be__rr rrc_voidprrrrrrrrrrobjectrrrrrrrcdllpydll dllhandle pythonapi version_infowindlloledllkernel32rrrrc_size_t c_ssize_tr r!r"r#memmovememsetr'r)r+r-r0r1r3r4r<r;rBctypes._endianrCrDrErFc_int8c_uint8kindc_int16c_int32c_int64c_uint16c_uint32c_uint64c_time_tr_rtr+r)rps82 ++)2+!!(/! -{O LL88t# 88w4==H4  9399;   $ $S )! ,-1" 77* "H88t.=*'//77 ]S XX)??(  36 6 Isl G| H\ Fl G S>Ys^# E F l G| H< ,6(++L S>Ys^#JK\ l  l.55w+ G\,22f) F\,22f) FV|V Hc|  H\:9V V l )<) N6N`9D988t))5 (, (!!9F9,Te88tlD$..9I ]]h*T->->r-BBCId I88t 6 "F 6 "F??//L60 &>VH%%HI G_x((HI KF8,,HIML <)Hh( ;M J 88Xuh 7 E > 9h 9=jI 4Z 8U 3O D ! &(9*Y%89IJK&88t=&E<   eVZ 0D d|qD'  dG  dG 1vw 4D d|qT(  tH  tH 5 AHaH BM3CD EE e  sV''V/.V/lib64/python3.12/wsgiref/__pycache__/__init__.cpython-312.pyc000064400000001450152361424500017433 0ustar00 ֦idZy)awsgiref -- 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 * types -- collection of WSGI-related types for static type checking 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__)/usr/lib64/python3.12/wsgiref/__init__.pyrs rusr/lib64/python3.12/xml/etree/__pycache__/__init__.cpython-312.pyc000064400000000214152361445700020504 0ustar00 ֦iEy)Nr+/usr/lib64/python3.12/xml/etree/__init__.pyrsrusr/lib64/python3.12/dbm/__pycache__/__init__.cpython-312.pyc000064400000014135152370330720017344 0ustar00 ֦idZgdZddlZddlZddlZddlZGddeZgdZda iZ ee fZ ddl m Z d dZd Zed k(r(ej$d dD]Zeeexsd eyy#e$rdZ Y>wxYw)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 eZdZy)rN)__name__ __module__ __qualname__%/usr/lib64/python3.12/dbm/__init__.pyrr&sr r)dbm.gnudbm.ndbmdbm.dumb)ndbmctCtD]"} t|dg}ts|a|t|<$tstdtzd|vr t |nd}|d|vsd|vrt}nOt dd|d k(rt dd |tvrt dd j|t|}|j|||S#t$rYwxYw) 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)fileflagmodenamemodresults r rr5sD  9!  HTN3 3v 88D$ %%5  sC CCctj|} tj|dzd}|j tj|dzd}|j y#t $rj tj|dzd}|j t 't j|}|j Yyn#t $rYnwxYwYnwxYw tj|dztj|dzj}|dk(ry tj|dzd} |jd d vr |j y |j n#|j wxYwn#t $rYnwxYw tj|d}n#t $rYywxYw|5|jd }dddn #1swYnxYwdd }t|d k7ry tjd|\}n#tj$rYywxYw|dvry tjd|dd\}y#tj$rYywxYw)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. s.pagrbs.dirrs.dbNs.datrr)'"rz=l)iΚWi͚WiϚWr )osfsencodeiorcloseOSErrorrstatst_sizereadlenstructunpackr)filenamefdsizes16smagics r rrbs5{{8$H GGHw& -  GGHw& -    6)40A GGIIIh' !    "  7"#wwx')*22 19 GGHw& - vvayL(! GGI) GGIAGGII     GGHd #  ffRj  AaA 1v{==q) << 44==s23x0  <<sAA** C4AC  C CCCCC!?F!F;E2F!F2FF FFF// F;:F;GG$<HH+*H+4II&%I&__main__r$UNKNOWN)ri)__doc____all__r,r*r3sys Exceptionrrrrr.dbmrrrrrargvr5printr r r rFs: '  I  -   *&ZWt zHHQRL gh,9h7!W DsA**A43A4usr/lib64/python3.12/tomllib/__pycache__/__init__.cpython-312.pyc000064400000000461152370512140020237 0ustar00 ֦i4*dZddlmZmZmZee_y))loadsloadTOMLDecodeError)rrrN)__all___parserrrr__name__ __module__)/usr/lib64/python3.12/tomllib/__init__.pyr s /11&r lib64/python3.12/tkinter/__pycache__/__init__.cpython-312.pyc000064400000740113152372136600017456 0ustar00 ֦ip dZddlZddlZddlZddlZddlZej ZddlddlZdZ dZ e ejZ e ejZej Zej"Zej$Zej&dZej&dej*ZdZd Zd Zej2Zd Zej6Zdud ZGddej:ddZdZej@ejBGddZ"GddZ#d a$da%dZ&dvdZ'dZ(dZ)dZ*dwdZ+da,GddZ-Gdde-Z.Gd d!e-Z/Gd"d#e-Z0Gd$d%e-Z1dwd&Z2e3Z4e Z5d'Z6Gd(d)Z7Gd*d+Z8Gd,d-Z9Gd.d/Z:Gd0d1Z;Gd2d3e7e;Zdxd6Z?Gd7d8Z@Gd9d:ZAGd;d<ZBGd=d>e7ZCGd?d@eCe@eAeBZDGdAdBeCe;ZEGdCdDeDZFGdEdFeDe9e:ZGdaHGdGdHeDZIGdIdJeDe9ZJGdKdLeDZKGdMdNeDZLGdOdPeDe9e:ZMGdQdReDZNGdSdTeDZOGdUdVeDZPGdWdXeDZQGdYdZeDZRGd[d\eDZSGd]d^eDe9e:ZTGd_d`ZUGdadbeOZVGdcddZWGdedfeWZXGdgdheWZYdiZZdjZ[GdkdleDe9Z\GdmdneDZ]GdodpeDZ^dqZ_e`jDcgc]/\}}|jdrsec|ejs|dsvr|1c}}Zeefdtk(re_yy#e$rYwxYw#e$rYwxYwcc}}w)ya8Wrapper 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)*Fz([\\{}])z([\s])c@djtt|S)Internal function. )joinmap _stringifyvalues )/usr/lib64/python3.12/tkinter/__init__.py_joinr:s 88C E* ++c&t|ttfrHt|dk(r*t |d}t j |rd|z}|Sdt|z}|St|tr t|d}n t|}|sd}|St j |rMt jd|}|jdd}tjd|}|dd k(rd |z}|S|dd k(stj |rd|z}|S) rrrz{%s}latin1z{}z\\\1 z\n"\) isinstancelisttuplelenr _magic_researchrbytesstrsubreplace _space_rer s r r r ?s%$' u:?uQx(E&& L#U5\)E" L eU #x(EJEE L  e $MM'51EMM$.EMM'51EQx3u  L1X_ 0 0 7UNE Lrctd}|D]0}t|ttfr|t|z}(|+||fz}2|S)r)rrr_flatten)seqresitems r r"r"[sE C dUDM *&C  -C  Jrc6t|tr|St|tdtfr|Si}t |D]} |j ||S#t tf$r3}td||jD] \}}|||< Yd}~Vd}~wwxYw)rNz_cnfmerge: fallback due to:) rdicttyperr"updateAttributeError TypeErrorprintitems)cnfscnfcmsgkvs r _cnfmerger4js$ D4:s+ , $A  1   #I. 3S9GGIDAqCF& sAB%)BBTc|j|}t|dzr tdt|}i}t ||D].\}}t |}|r |ddk(r|dd}|r||}|||<0|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) tkr3 cut_minusconvtitr'keyr s r _splitdictrBs QA 1vzCD D aB D"bk U#h Q3ab'C KES " KrceZdZdZy)_VersionInfoTypec|jdk(r(|jd|jd|jS|jd|j|jd|jS)Nfinal.r) releaselevelmajorminormicroserialselfs r __str__z_VersionInfoType.__str__sd    'jj\4::,a |< <jj\4::,t/@/@/C.DT[[MR RrN)__name__ __module__ __qualname__rOr!rr rDrDsSrrD)rIrJrKrHrLcddl}|jd|}|j\}}}}t|t|t|}}}|dk(r|}d}d}n d}ddd|}t |||||S)Nrz(\d+)\.(\d+)([ab.])(\d+)rGrFalphabeta)ab)re fullmatchgroupsintrD)versionrXmrIrJrHrLrKs r _parse_versionr^s  0':A)*&E5,u:s5z3v;&5Es $62<@ E5%v FFrceZdZdZeZdZdZeZdZdZ 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)y&)' EventType234567891011121314151617181920212223242526272829303132333435363738N)*rPrQrRKeyPressKey KeyRelease ButtonPressButton ButtonReleaseMotionEnterLeaveFocusInFocusOutKeymapExposeGraphicsExposeNoExpose VisibilityCreateDestroyUnmapMap MapRequestReparent ConfigureConfigureRequestGravity ResizeRequest CirculateCirculateRequestPropertySelectionClearSelectionRequest SelectionColormap ClientMessageMapping VirtualEventActivate Deactivate MouseWheelr!rr r`r`sH CJK FM F E EGH F FNHJ FG E CJHIGMIHNIHMGLHJJrr`ceZdZdZdZy)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) c |jjDcic]\}}|dk7s ||c}} |js d=n'|jdk7rt|j d<t |dds d=|j dk(r d=nt |j tr|j }d}g}t|D]\}}|d|zzs|j|!|dt|zdz z}|s|s|jt|d j| d<|jdk(r d =d }d t |jd |jddj fd|DdScc}}w)Nz??char send_eventTrstate) ShiftLockControlMod1Mod2Mod3Mod4Mod5Button1Button2Button3Button4Button5r|delta) rrkeysymkeycodernumrfocusxywidthheight<namez eventc3>K|]}|vsd|d|yw)r=Nr!).0r2attrss r z!Event.__repr__..'s!Ida5j58,ds >)__dict__r-rreprgetattrrrr[ enumerateappendrhexrrr() rNr2r3rmodssinkeysrs @r __repr__zEvent.__repr__sh"&--"5"5"7E"7$!Q19A"7Eyyf YY$  OE&Mt\40l# ::?g  C (JJEKDA!$1AF#HHQK(q3t9}122EAU$ XXa[E'N ::?g - DIIvtyy 1 GGIdI I  AFs FFN)rPrQrR__doc__rr!rr rrs (T$ rrcdadaby)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!rr NoDefaultRootr/s"Mrcts tdt%|rtd|dt}t|usJtS)NINo master specified and tkinter is configured to not support default rootz Too early to z: no default root window)rr9rTk)whatroots r _get_default_rootr=sS DE E tf4LMN Nt$$$ rcts tdt}|5tsJdat}datJ|j d|_|S)NrFT)rr9rrwithdraw _temporaryrs r _get_temp_rootrIsa DE E D |$$$ %t $$$$  Krc`t|ddr |jyy#t$rYywxYw)NrF)rdestroyTclErrormasters r _destroy_temp_rootrZs6v|U+  NN ,   s ! --cyrNr!)errs r _tkerrorrbsrcb t|}t|#t$r Yt|wxYw)zBInternal function. Calling it will raise the exception SystemExit.)r[ ValueError SystemExit)codes r _exitrgs< 4y T    T  s  ..cteZdZdZdZdZdZddZdZdZ dZ e Z dZ d Z d Zd Zd Zd ZeZdZdZdZy)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().rNc|t|ts td| td}|j |_|j |_|r||_n dttz|_tdz a ||j|y|j j|j jdd|js|j|jyy)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+r_rootr<_tk_namer_varnum initialize getbooleancall_defaultrNrr rs r __init__zVariable.__init__|s  JtS$934 4 >&'89F\\^ 99 DJ!DM1DJ qLG   OOE "$$TXX]]68TZZ%PQ OODMM *Rrch|jy|jj|jjdd|jr%|jj |j|j 4|j D]}|jj |d|_yy)zUnset the variable in Tcl.Nrr)rr r rglobalunsetvar _tclCommands deletecommandrNrs r __del__zVariable.__del__s 88   88  txx}}VXtzzJ K HH # #DJJ /    ())&&t,* $D  )rc|jS)z'Return the name of the variable in Tcl.)rrMs r rOzVariable.__str__s zzrcN|jj|j|SzSet the variable to VALUE.)r globalsetvarrrNr s r setz Variable.setsxx$$TZZ77rcL|jj|jS)zReturn value of variable.)r globalgetvarrrMs r getz Variable.getsxx$$TZZ00rczt|d|jj}tt |} |j } ||jz}|jj|||jg|_ |jj||S#t $rYgwxYw#t $rYfwxYwN) CallWrapperr__call__rid__func__r*rPr createcommandrr)rNcallbackfcbnames r _registerzVariable._registers $ 3 < <be ((H h///F vq)    $ "D    (       s# BB. B+*B+. B:9B:c~|j|}|jjddd|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. traceaddvariabler'rr rrNmoder$r&s r trace_addzVariable.trace_adds:)  gujjj$  3 rcZ|jjddd|j|||jD](\}}|jj |d|k(s(y|jj | |j j|y#t$rYywxYw)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(). r)remover+rN) rr r trace_infor8rrr1rrNr.r&r]cas r trace_removezVariable.trace_removes  gxjj$ 0__&EArxx!!"%a(F2' HH " "6 * !!((0  sB B*)B*c |jj}t|||jjddd|jDcgc]\}}|||fc}}Scc}}w)z&Return all trace callback information.r)rr+)rr8r r r)rNr8r2r3s r r2zVariable.trace_infosqHH&& .1) dhhmmGVZL M/OP/Oda1q!/OP PPsA*cz|j|}|jjdd|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. r)r+r,r-s r trace_variablezVariable.trace_variables3)  gz4::tVD rc|jjdd|j|||jj|d}|j D](\}}|jj|d|k(s(y|jj | |j j|y#t$rYywxYw)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. r)vdeleterN) rr rr8r2rrr1rr3s r trace_vdeletezVariable.trace_vdeletes  gy$**dFC##F+A.__&EArxx!!"%a(F2' HH " "6 * !!((0  sB;; CCc|jj|jjdd|jDcgc]}|jj|c}Scc}w)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. r)vinfo)rr8r rrNrs r trace_vinfozVariable.trace_vinfos`04xx/A/A HHMM'7DJJ 709:09!""1%09: ::s"A(ct|tstS|j|jk(xrH|jj |jj k(xr|j |j k(Sr)rrNotImplementedr __class__rPr)rNothers r __eq__zVariable.__eq__s]%*! ! ekk)*NN++u/G/GG*HH ) +rNNN)rPrQrRrr rrr rrOrrrr'r/r5r2r8r)r;r?rDr!rr rrssiAH CL+< %8J1" &P " E,:+rrc"eZdZdZdZddZdZy) StringVarz#Value holder for strings variables.rNc4tj||||y)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. Nrr r s r r zStringVar.__init__+ $t4rc|jj|j}t|tr|St |S)z#Return value of variable as string.)rrrrrrs r rz StringVar.get7s3%%djj1 eS !L5zrrErPrQrRrr r rr!rr rGrG's-H 5rrGc"eZdZdZdZddZdZy)IntVarz#Value holder for integer variables.rNc4tj||||y)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. NrIr s r r zIntVar.__init__CrJrc|jj|j} |jj|S#tt f$r't |jj|cYSwxYw)z/Return the value of the variable as an integer.)rrrgetintr+rr[ getdoublers r rz IntVar.getOs`%%djj1 288??5) )8$ 2txx))%01 1 2sA3A87A8rErLr!rr rNrN?s-H 52rrNc"eZdZdZdZddZdZy) DoubleVarz!Value holder for float variables.gNc4tj||||y)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. NrIr s r r zDoubleVar.__init__\rJrc~|jj|jj|jS)z,Return the value of the variable as a float.)rrRrrrMs r rz DoubleVar.geths*xx!!$(("7"7 "CDDrrErLr!rr rTrTXs+H 5ErrTc,eZdZdZdZddZdZeZdZy) BooleanVarz#Value holder for boolean variables.FNc4tj||||y)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. NrIr s r r zBooleanVar.__init__qrJrc|jj|j|jj|Sr)rrrr rs r rzBooleanVar.set}s,xx$$TZZ1D1DU1KLLrc |jj|jj|jS#t$r t dwxYw)z+Return the value of the variable as a bool. invalid literal for getboolean())rr rrrrrMs r rzBooleanVar.getsM A88&&txx'<'d9Z?d:Z@d;ZAd<ZBd=ZCdd>ZDd?ZEd@ZFdAZGdBZHddCZIdDZJdEZKdFZLdGZMdHZNdIZOdJZPdKZQdLZRdMZSdNZTdOZUdPZVdQZWdRZXdSZYdTZZdUZ[dVZ\dWZ]dXZ^dYZ_ddZZ`d[Zad\Zbd]Zcd^Zdd_Zed`ZfdaZgdbZhdcZiddZjdeZkddfZlddgZmddhZnddiZoddjZpddkZqdlZrddmZsdnZtddoZudpZvdqZwdrZxdsZydtZze{duZ|ddvZ}dwZ~e~ZddxZeZdyZdzZd{j eZd|Zd}Zd~ZdZdZddZeZdZeZdZdZdZdZdgZefdZeZdZeZdZddZeZddZeZdZdZifdZeZdZefdZifdZeZdZeZddZdZdZdZddZdZdZy)MisczRInternal class. Base class which defines methods common for interior widgets.Nc|j4|jD]}|jj|d|_yy)zkInternal function. Delete all Tcl commands created for this widget in the Tcl interpreter.N)rr<rrs r rz Misc.destroys?    ())%%d+* $D  )rc|jj| |jj|y#t$rYywxYw)zDInternal function. Delete the Tcl command provided in NAME.N)r<rrr1rrs r rzMisc.deletecommandsA d#     $ $T *   s9 AAcn|jj|jjdd|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)r<r r rNbooleans r rezMisc.tk_strictMotifs2ww!!$'',, #W#./ /rc:|jjdy)zDChange the color scheme to light brown as used in Tk 3.6 and before. tk_bisqueNr<r rMs r rizMisc.tk_bisques  [!rc |jjdt|ztt|j zy)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)r<r r"rr-rNargskws r rlzMisc.tk_setPalettes;  '!)$rxxz*:!;< =rc>|jjdd|y)zWait until the variable is modified. A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.tkwaitr+Nrjrs r wait_variablezMisc.wait_variables  Xz40rcZ||}|jjdd|jy)zQWait until a WIDGET is destroyed. If no parameter is given self is used.Nrqwindowr<r _wrNrts r wait_windowzMisc.wait_windows& >F  Xx3rcZ||}|jjdd|jy)zxWait until the visibility of a WIDGET changes (e.g. it appears). If no parameter is given self is used.Nrq visibilityrurws r wait_visibilityzMisc.wait_visibilitys& >F  X|VYY7rc<|jj||y)zSet Tcl variable NAME to VALUE.N)r<setvar)rNrr s r r}z Misc.setvars tU#rc8|jj|S)z"Return value of Tcl variable NAME.)r<getvarrs r rz Misc.getvarsww~~d##rc |jj|S#t$r}tt |d}~wwxYwr)r<rQrrrrNrexcs r rQz Misc.getints9 '77>>!$ $ 'SX& & ' ?:?c |jj|S#t$r}tt |d}~wwxYwr)r<rRrrrrs r rRzMisc.getdoubles; '77$$Q' ' 'SX& & 'rcj |jj|S#t$r tdwxYw)zPReturn a boolean value for Tcl boolean values true and false given as parameter.r\)r<r rr)rNrs r r zMisc.getbooleans: A77%%a( ( A?@ @ As2cP|jjd|jy)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.rNrurMs r focus_setzMisc.focus_sets  Wdgg&rcR|jjdd|jy)ztDirect input focus to this widget even if the application does not have the focus. Use with caution!rz-forceNrurMs r focus_forcezMisc.focus_forces  Wh0rcj|jjd}|dk(s|sy|j|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.rnoneN)r<r  _nametowidgetrs r focus_getzMisc.focus_gets2ww||G$ 6>d!!$''rc|jjdd|j}|dk(s|sy|j|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.r -displayofrNr<r rvrrs r focus_displayofzMisc.focus_displayof(s: ww||G\477; 6>d!!$''rc|jjdd|j}|dk(s|sy|j|S)zyReturn the widget which would have the focus if top level for this widget gets the focus from the window manager.rz-lastforrNrrs r focus_lastforzMisc.focus_lastfor1s:ww||GZ9 6>d!!$''rc:|jjdy)zXThe widget under mouse will get automatically focus. Can not be disabled easily.tk_focusFollowsMouseNrjrMs r rzMisc.tk_focusFollowsMouse8s  +,rcv|jjd|j}|sy|j|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_focusNextNrrs r rzMisc.tk_focusNext=s2ww||NDGG4D!!$''rcv|jjd|j}|sy|j|S)zHReturn previous widget in the focus order. See tk_focusNext for details. tk_focusPrevNrrs r rzMisc.tk_focusPrevJs0ww||NDGG4D!!$''rc*jjd|yfd} j|_j |jjd|S#t$rt j|_YSwxYw)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.Nafterc  jy#t$rYywxYw# jw#t$rYwwxYwxYwr)rr)rnfuncrrNsr callitzMisc.after..callit\sY$K**40#**40#s5* ''A >A  A A  A  A )r<r rPr*r(r')rNmsrrnrrs` `` @r rz Misc.afterPs} < GGLL" %  6"&-->>&)D77<<T2 2 " 6"&t*"5"5 6sA,,#BBc*|jd|g|S)zCall FUNC once if the Tcl main loop has no event to process. Return an identifier to cancel the scheduling with after_cancel.idle)r)rNrrns r after_idlezMisc.after_idlels tzz&$...rc|s td |jjdd|}|jj|d}|j ||jjdd|y#t $rY)wxYw)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_idlerrrcancelN)rr<r r8rr)rNr!datascripts r after_cancelzMisc.after_cancelts 34 4 77<<4DWW&&t,Q/F   v &  Wh+   sA A99 BBc^|jjd|j|zy)zRing a display's bell.)bellN)r<r  _displayofrN displayofs r rz Misc.bells   Y!;; *6 ww||$84==;L$LMMww||04==3DDEE vJ s1A44 BBc d|vr|j|d<|jjd|j|zy)zClear the data in the Tk clipboard. A widget specified for the optional displayof keyword argument specifies the target display.r)rclearNrvr<r rrs r clipboard_clearzMisc.clipboard_clears7 b DGG"[/  +dmmB.??@rc d|vr|j|d<|jjd|j|zd|fzy)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)rr--Nr)rNstringros r clipboard_appendzMisc.clipboard_appendsE b DGG"[/  ,t}}R/@@v rcx|jjdd|j}|sy|j|S)zOReturn widget which has currently the grab in this application or None.grabcurrentNrrs r grab_currentzMisc.grab_currents4ww||FItww7D!!$''rcR|jjdd|jy)z.Release grab for this widget if currently set.rreleaseNrurMs r grab_releasezMisc.grab_releases  VY0rcR|jjdd|jy)zwSet grab for this widget. A grab directs all events to this and descendant widgets in the application.rrNrurMs r grab_setz Misc.grab_sets  VUDGG,rcT|jjddd|jy)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-globalNrurMs r grab_set_globalzMisc.grab_set_globals  VUItww7rcb|jjdd|j}|dk(rd}|S)zYReturn None, "local" or "global" if this widget has no, a local or a global grab.rstatusrNru)rNrs r grab_statuszMisc.grab_statuss/fh8 V dV rcB|jjdd|||y)zSet a VALUE (second parameter) for an option PATTERN (first parameter). An optional third parameter gives the numeric priority (defaults to 80).optionr*Nrj)rNpatternr prioritys r option_addzMisc.option_adds  Xuguh?rc<|jjddy)zPClear the option database. It will be reloaded if option_add is called.rrNrjrMs r option_clearzMisc.option_clears  Xw'rcT|jjdd|j||S)zReturn the value for an option NAME for this widget with CLASSNAME. Values with higher priority override lower values.rrru)rNr classNames r option_getzMisc.option_gets# ww||HeTWWdIFFrc@|jjdd||y)zvRead file FILENAME into the option database. An optional second parameter gives the numeric priority.rreadfileNrj)rNfileNamers r option_readfilezMisc.option_readfiles  Xz8X>rc d|vr|j|d<|jjd|j|zy)zClear the current X selection.r) selectionrNrrs r selection_clearzMisc.selection_clears5 b DGG"[/  +dmmB.??@rc 2d|vr|j|d<d|vrB|jdk(r3 d|d<|jjd|j |zS|jjd|j |zS#t $r|d=Y;wxYw)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)rr)rvrr<r rrrs r selection_getzMisc.selection_gets b DGG"[/   5 5 > *6 ww||$84==;L$LMMww||04==3DDEE vJ s1B BBc |j|}|jjd|j|z|j|fzy)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).)rhandleN)r'r<r rrv)rNcommandrors r selection_handlezMisc.selection_handlesC~~g&  ,t}}R/@@$  !rc z|jjd|j|z|jfzy)zBecome owner of X selection. A keyword parameter selection specifies the name of the selection (default PRIMARY).rownN)r<r rrvrs r selection_ownzMisc.selection_owns6  )r"#&*ggZ0 1rc d|vr|j|d<|jjd|j|z}|sy|j |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)rvr<r rr)rNrors r selection_own_getzMisc.selection_own_get sO b DGG"[/ww||04==3DDED!!$''rcD|jjd||f|zS)zDSend Tcl command CMD to different interpreter INTERP to be executed.sendrj)rNinterpcmdrns r rz Misc.send,s!ww||VVS1D899rcR|jjd|j|y)z(Lower this widget in the stacking order.lowerNru)rN belowThiss r rz Misc.lower0  Wdggy1rcR|jjd|j|y)z(Raise this widget in the stacking order.raiseNru)rN aboveThiss r tkraisez Misc.tkraise4rrcP|jjdd}t|S)z-Returns the exact version of the Tcl library.r patchlevel)r<r r^)rNrs r info_patchlevelzMisc.info_patchlevel:s!WW\\&,7 j))rcd|j|z|fz}|jj|jj|S)z*Return integer which represents atom NAME.)winfoatom)rr<rQr )rNrrrns r winfo_atomzMisc.winfo_atom?s< 4??9#==Gww~~dggll4011rchd|j|z|fz}|jj|S)z'Return name of atom with identifier ID.)ratomname)rr<r rNr!rrns r winfo_atomnamezMisc.winfo_atomnameDs5$+,/1e4ww||D!!rc|jj|jjdd|jS)z7Return number of cells in the colormap for this widget.rcellsr<rQr rvrMs r winfo_cellszMisc.winfo_cellsJ/ww~~ GGLL'477 35 5rcg}|jj|jjdd|jD]#} |j |j |%|S#t $rY3wxYw)z?Return a list of all widgets which are children of this widget.rchildren)r<r8r rvrrKeyError)rNresultchilds r winfo_childrenzMisc.winfo_childrenOsqWW&& GGLL*dgg 68E  d0078 8   s A++ A76A7cP|jjdd|jS)z(Return window class name of this widget.rclassrurMs r winfo_classzMisc.winfo_class\sww||GWdgg66rc|jj|jjdd|jS)z?Return True if at the last color request the colormap was full.r colormapfullr<r r rvrMs r winfo_colormapfullzMisc.winfo_colormapfull`s1ww!! GGLL.$'' :<  >rc|jj|jjdd|jS)z:Return the x coordinate of the pointer on the root window.rpointerxrrMs r winfo_pointerxzMisc.winfo_pointerxr0rcn|j|jjdd|jS)zHReturn a tuple of x and y coordinates of the pointer on the root window.r pointerxy_getintsr<r rvrMs r winfo_pointerxyzMisc.winfo_pointerxys+}} GGLL+tww 79 9rc|jj|jjdd|jS)z:Return the y coordinate of the pointer on the root window.rpointeryrrMs r winfo_pointeryzMisc.winfo_pointeryr0rc|jj|jjdd|jS)z'Return requested height of this widget.r reqheightrrMs r winfo_reqheightzMisc.winfo_reqheights/ww~~ GGLL+tww 79 9rc|jj|jjdd|jS)z&Return requested width of this widget.rreqwidthrrMs r winfo_reqwidthzMisc.winfo_reqwidthr0rcp|j|jjdd|j|S)zNReturn a tuple of integer RGB values in range(65536) for color in this widget.rrgbrE)rNcolors r winfo_rgbzMisc.winfo_rgbs-}} GGLL%% 8: :rc|jj|jjdd|jS)zSReturn x coordinate of upper left corner of this widget on the root window.rrootxrrMs r winfo_rootxzMisc.winfo_rootx1ww~~ GGLL'477 35 5rc|jj|jjdd|jS)zSReturn y coordinate of upper left corner of this widget on the root window.rrootyrrMs r winfo_rootyzMisc.winfo_rootyrXrcP|jjdd|jS)z&Return the screen name of this widget.rscreenrurMs r winfo_screenzMisc.winfo_screenr9rc|jj|jjdd|jS)zTReturn the number of the cells in the colormap of the screen of this widget.r screencellsrrMs r winfo_screencellszMisc.winfo_screencells1ww~~ GGLL- 9; ;rc|jj|jjdd|jS)z\Return the number of bits per pixel of the root window of the screen of this widget.r screendepthrrMs r winfo_screendepthzMisc.winfo_screendepthrbrc|jj|jjdd|jS)zXReturn the number of pixels of the height of the screen of this widget in pixel.r screenheightrrMs r winfo_screenheightzMisc.winfo_screenheights1ww~~ GGLL.$'' :<  >rc|jj|jjdd|jS)zTReturn the number of pixels of the width of the screen of this widget in mm.r screenmmwidthrrMs r winfo_screenmmwidthzMisc.winfo_screenmmwidths1ww~~ GGLL/477 ;= =rcP|jjdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen.r screenvisualrurMs r winfo_screenvisualzMisc.winfo_screenvisualsww||G^TWW==rc|jj|jjdd|jS)zWReturn the number of pixels of the width of the screen of this widget in pixel.r screenwidthrrMs r winfo_screenwidthzMisc.winfo_screenwidthrbrcP|jjdd|jS)zxReturn information of the X-Server of the screen of this widget in the form "XmajorRminor vendor vendorVersion".rserverrurMs r winfo_serverzMisc.winfo_serversww||GXtww77rcn|j|jjdd|jS)z*Return the toplevel widget of this widget.rtoplevel)rr<r rvrMs r winfo_toplevelzMisc.winfo_toplevel s/!!$'',, Z#*+ +rc|jj|jjdd|jS)zBReturn true if the widget and all its higher ancestors are mapped.rviewablerrMs r winfo_viewablezMisc.winfo_viewabler0rcP|jjdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.rvisualrurMs r winfo_visualzMisc.winfo_visualsww||GXtww77rcP|jjdd|jS)z7Return the X identifier for the visual for this widget.rvisualidrurMs r winfo_visualidzMisc.winfo_visualidr%rc.|jjdd|j|rdnd}|jj|Dcgc]}|jj|}}|Dcgc]}|j |c}Scc}wcc}w)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.rvisualsavailable includeidsN)r<r rvr8_Misc__winfo_parseitem)rNrrrs r winfo_visualsavailablezMisc.winfo_visualsavailables ww||G%7,6LDB.2gg.?.?.EF.E!!!$.EF3784a&&q)488G8s "B 2Bc R|ddtt|j|ddzS)rNr)rr _Misc__winfo_getint)rNr?s r __winfo_parseitemzMisc.__winfo_parseitem(s+!uuS!4!4ae<===rct|dS)rr)r[r>s r __winfo_getintzMisc.__winfo_getint,s1ayrc|jj|jjdd|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.r vrootheightrrMs r winfo_vrootheightzMisc.winfo_vrootheight0s1ww~~ GGLL- 9; ;rc|jj|jjdd|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.r vrootwidthrrMs r winfo_vrootwidthzMisc.winfo_vrootwidth7s1ww~~ GGLL, 8: :rc|jj|jjdd|jS)ziReturn the x offset of the virtual root relative to the root window of the screen of this widget.rvrootxrrMs r winfo_vrootxzMisc.winfo_vrootx>1ww~~ GGLL(DGG 46 6rc|jj|jjdd|jS)ziReturn the y offset of the virtual root relative to the root window of the screen of this widget.rvrootyrrMs r winfo_vrootyzMisc.winfo_vrootyDrrc|jj|jjdd|jS)z Return the width of this widget.rrrrMs r winfo_widthzMisc.winfo_widthJrrc|jj|jjdd|jS)zVReturn the x coordinate of the upper left corner of this widget in the parent.rrrrMs r winfo_xz Misc.winfo_xO1ww~~ GGLL#tww /1 1rc|jj|jjdd|jS)zVReturn the y coordinate of the upper left corner of this widget in the parent.rrrrMs r winfo_yz Misc.winfo_yUrrc:|jjdy)zEEnter event loop until all pending events have been processed by Tcl.r)NrjrMs r r)z Misc.update[s  Xrc<|jjddy)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) idletasksNrjrMs r update_idletaskszMisc.update_idletasks_s  X{+rc|?|jj|jjd|jS|jjd|j|y)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).Nbindtagsr<r8r rv)rNtagLists r rz Misc.bindtagsesP ?77$$ Z13 3 GGLLTWWg 6rct|tr!|jj|||fzy|r\|j ||j |}|xrdxsdd|d|j d}|jj|||fz|S|r|jj||fzS|jj|jj|S)r+rif {"[rz]" == "break"} break N)rrr<r r' _substitute_subst_format_strr8)rNrsequencerr* needcleanupfuncidrs r _bindz Misc._bindrs dC GGLL4 00 1 ^^D$*:*:#%FKC%2%..0C GGLL3/ 0M 77<<{ 23 377$$TWW\\$%78 8rcB|jd|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.bindrrvrNrrr*s r rz Misc.binds#Nzz6477+XtSAArcB|jd|j|f|y)aUnbind for this widget the event SEQUENCE. If FUNCID is given, only unbind the function identified with FUNCID and also delete the corresponding Tcl command. Otherwise destroy the current binding for SEQUENCE, leaving SEQUENCE unbound. rN_unbindrv)rNrrs r unbindz Misc.unbinds fdggx0&9rc^||jjg|dy|jj|jd}d|ddjfd|D}|j sd}|jjg|||j |y)Nrrrrc3DK|]}|js|ywr) startswith)rlineprefixs r rzMisc._unbind..s#=ed$(OOF$;"es )r<r splitrstripr)rNrrlineskeeprs @r rz Misc._unbinds > DGGLL #$ # #GGLL&,,T2Evha(F99=e==D::< DGGLL %$ % %   v &rcH|jjd|||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.)rallTrrrs r bind_allz Misc.bind_alls# zz|!!/8T3MMrcH|jjdd|fy)z8Unbind for all widgets for event SEQUENCE all functions.rrNrr)rNrs r unbind_allzMisc.unbind_alls feX67rcL|jjd|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.rTr)rNrrrr*s r bind_classzMisc.bind_classs(zz|!!69"5xsDQQrcH|jjd||fy)zWUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.rNr)rNrrs r unbind_classzMisc.unbind_classs fi:;rc:|jj|y)zCall the mainloop of Tk.N)r<r^)rNrs r r^z Misc.mainloops rc8|jjy)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r<quitrMs r rz Misc.quits  rc|rBtt|jj|jj |Syr)rr r<rQr8rNrs r rFz Misc._getintss3 TWW^^TWW->->v-FGH H rc|rBtt|jj|jj |Syr)rr r<rRr8rs r _getdoubleszMisc._getdoubless5 TWW..0A0A&0IJK K rc>|r|jj|Syr)r<r rs r _getbooleanzMisc._getbooleans 77%%f- - rc0|rd|fS|d|jfSy)rrr!rvrs r rzMisc._displayofs(  ), ,   $''* *rc |jjS#t$r6|jj ddx}|j_|cYSwxYw)rr<windowingsystem)r_windowingsystem_cachedr*r<r )rNwss r rzMisc._windowingsystemsR ::<77 7  T+<= >B5I s.getint_event]s+ ay )  s  r)r _subst_formatr<r rQrrLrrrrrrtimerrrrrr keysym_numr`r(rrwidgetrx_rooty_rootr)rNrnr rnsignrWr%hr2rr?rrrAEKNWTXYDerQs @r rzMisc._substituteWs t9D../ /WW''  GKCq!Q1aAq!Q1aAq! G%=Q!!}QW? O q/aq/1o1o&qMQ\#A  q\AF ))!,AH ?? QiAGt 7  AF  AH  H% AGt  sZ E3? F!F2F'# F=3 E?>E? F FF$#F$'F:9F:=GGcztj\}}}|j}|j|||yr)sysexc_inforreport_callback_exception)rNrvaltbrs r _report_exceptionzMisc._report_exceptions0||~ S"zz| &&sC4rci}|jj|jj|D]5}|jj|}|dddf|ddz||ddd<7|S)z;Call Tcl configure command and return the result as a dict.rrNr<r8r )rNrnr/rs r _getconfigurezMisc._getconfigurest""<477<<#67A!!!$AqT!"XK!AB%/C!QRM8 rc|jj|jj|}|dddf|ddzS)NrrrrNrnrs r _getconfigure1zMisc._getconfigure1sB GG  ldggllD1 2!QR{QqrU""rc|rt||f}n |r t|}|&|jt|j|fSt |t r*|j t|j|d|zfS|jjt|j|f|j|zy)rNr7) r4rr"rvrrr r<r r)rNrr/ros r _configurezMisc._configures S"I&C C.C ;%%h~&>? ? c3 &&x#s3w0G'HI I  Xtwwn- c0BBCrc (|jd||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. configurer rNr/ros r rzMisc.configures{C44rcV|jj|jdd|zS)z4Return the resource value for a KEY given as string.cgetr7rurNrAs r rz Misc.cgets!ww||DGGVS3Y77rc*|j||iyr)rrNrAr s r __setitem__zMisc.__setitem__s U|$rc|jj}||jj|jdDcgc]}||dddc}Scc}w)z3Return a list of all resource names of this widget.rrrNr)rNr8rs r rz Misc.keyss]GG%% $'',,tww <=?=)* ! Q#=? ??sAc|jS)z+Return the window path name of this widget.rrMs r rOz Misc.__str__s wwrc~d|jjd|jjd|jdS)NrrGz object r)rBrQrRrvrMs r rz Misc.__repr__s- NN % %t~~'B'BDGGM Mr_noarg_c|tjur6|j|jj dd|j S|jj dd|j |y)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 propagateNrarrr<r rvrNflags r pack_propagatezMisc.pack_propagateY 4<< ##DGGLL TWW%./ / GGLLdggt s r pack_slaveszMisc.pack_slavess_!!77<<$'':<=<+,""1%<= ==Ac|jj|jjdd|jDcgc]}|j |c}Scc}w)r$placer%r&r>s r place_slaveszMisc.place_slavessb!!77<<$''3454+,""1%45 55r(cT|jjdd|j|y)zThe anchor value controls how to place the grid within the master when no row/column has any weight. The default anchor is nw.gridanchorNru)rNr.s r grid_anchorzMisc.grid_anchors  VXtww7rcdd|jf}| ||||fz}| ||||fz}|j|jj|xsdS)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. r-bboxN)rvrFr<r )rNcolumnrowcol2row2rns r grid_bboxzMisc.grid_bboxsh(  #/63-'D   04,&D}}\TWW\\4019T9rct|ttjfrI t|}|syd|vr|jj |S|jj |S|S#ttf$rY|SwxYw)NrG) rr_tkinterTcl_Objr<rRrQrr)rNr svalues r _gridconvvaluezMisc._gridconvvalues ec8#3#34 5 UF]77,,V4477>>&11 )   s A,A,A,,A?>A?c t|tr |s|dddk(r|dd}|dddk7rd|z}|f}n|j||}|sHt|j|jj d||j ||jS|jj d||j |f|z}t|dk(r|j|Sy)rrNrrr7r-)r>) rrrrBr<r rvr;r)rNrindexr/rooptionsr$s r _grid_configurezMisc._grid_configure's c3 23x3#2h2Aw#~#gfGmmC,G VWdggu=((* *ggll7DGGU3 w<1 &&s+ + rc *|jd|||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).columnconfigurer?rNr=r/ros r grid_columnconfigurezMisc.grid_columnconfigure<s ##$5uc2FFrc z|j|jjdd|j||xsdS)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.r-locationNrErNrrs r grid_locationzMisc.grid_locationFs<}} GGLL DGGQ 34<7; >) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs.eventr*NrjrNvirtual sequencesrns r event_addzMisc.event_add{s%(94  TrcJdd|f|z}|jj|y)z-Unbind a virtual event VIRTUAL from SEQUENCE.rTdeleteNrjrUs r event_deletezMisc.event_deletes#7+i7  Trc dd|j|f}|jD]\}}|d|zt|fz}|jj |y)zGenerate an event SEQUENCE. Additional keyword arguments specify parameter of the event (e.g. x, y, rootx, rooty).rTgenerate-%sN)rvr-rr<r )rNrrornr2r3s r event_generatezMisc.event_generatesQTWWh7HHJDAq519c!f--D  Trcn|jj|jjdd|S)zuReturn a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL.rTrr)rNrVs r event_infozMisc.event_infos/ww  GGLL&' 24 4rcl|jj|jjddS)z*Return a list of all existing image names.imagenamesrrMs r image_nameszMisc.image_names&ww  gw!?@@rcl|jj|jjddS)z?Return a list of all available image types (e.g. photo bitmap).rctypesrrMs r image_typeszMisc.image_typesrfrr)r)r1rF)rrE)NrNNNNNN)rPrQrRr_last_child_idsrrrrerirlrrwaitvarrxr{r}rrQrRr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrliftrrrrr r rrrrr!r$r'r)r,r/r3r5r8r<r?rBrGrJrMrPrTrWr[r^rarerhrkrnrqrtrwrzr}rrrrrrrrrrrrr)rrrrrrrrrrr^rrFrrrpropertyrrrrr'registerrrrrrrrr r rconfigr __getitem__rrrOrrr!rr'r%r+r/r.r6r1r;r?rDrArHrJrMrLrPrOrRrXr[r_rarerir!rr rarasE OL%/" =1 G48$$' ' A' E1 (((- (( 38/,"= F.A (1-8@( G?A F$! 1 (:22 D* 2 " 5 7< (G6 2 :6 <5 8 968"> 8 9 8 9 8 : 5 5 8; ; < > = > ; 8 + 8 8 : 9>;:6 6 5 1 1 , 79$'BR : 'N8R< I L . 4"!M,H CM/;z5 # D5F8K%? M kG") =I=F58F:& D ,*/1G+O<#* =,.D%L; D 9 4AArraceZdZdZdZdZy)rzwInternal class. Stores function to call when some user defined Tcl function is called e.g. after an event occurred.c.||_||_||_y)z(Store FUNC, SUBST and WIDGET as members.N)rrr)rNrrrs r r zCallWrapper.__init__s   rc |jr|j|}|j|S#t$r|jj YyxYw)z3Apply first function SUBST to arguments, than FUNC.N)rrrrrrNrns r r zCallWrapper.__call__sQ ,zz!tzz4(499d# #   , KK ) ) +s ),%ANrPrQrRrr r r!rr rrsD ,rrc"eZdZdZdZdZdZy)XViewzXMix-in class for querying and changing the horizontal position of a widget's window.cz|jj|jdg|}|s|j|Sy)z5Query and change the horizontal position of the view.xviewNr<r rvrrNrnr$s r r~z XView.xview:dggll477G3d3##C( (rcT|jj|jdd|y)zsAdjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.r~movetoNrurNfractions r xview_movetozXView.xview_moveto  TWWgx:rcV|jj|jdd||y)z\Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).r~scrollNrurNr rs r xview_scrollzXView.xview_scroll   TWWgx>rN)rPrQrRrr~rrr!rr r|r|) ; ?rr|c"eZdZdZdZdZdZy)YViewzVMix-in class for querying and changing the vertical position of a widget's window.cz|jj|jdg|}|s|j|Sy)z3Query and change the vertical position of the view.yviewNrrs r rz YView.yviewrrcT|jj|jdd|y)zsAdjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.rrNrurs r yview_movetozYView.yview_movetorrcV|jj|jdd||y)z\Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT).rrNrurs r yview_scrollzYView.yview_scrollrrN)rPrQrRrrrrr!rr rrrrrc|eZdZdZ d"dZeZdZeZd#dZeZ dZ e Z d#dZ e Z dZeZd#d ZeZd ZeZd ZeZd#d ZeZ d"d ZeZd#dZeZd$dZeZdZeZd#dZ e Z!d#dZ"e"Z#d%dZ$e$Z%d$dZ&e&Z'd#dZ(e(Z)dZ*e*Z+d$dZ,e,Z-d$dZ.e.Z/d#dZ0e0Z1d#dZ2e2Z3d$dZ4e4Z5d$dZ6e6Z7d#dZ8e8Z9d#dZ:e:Z;d#dZe>Z?d!Z@e@ZAy)&WmzAProvides functions for the communication with the window manager.Nc v|j|jjdd|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.wmaspectrE)rNminNumerminDenommaxNumermaxDenoms r wm_aspectz Wm.wm_aspects9 }} GGLLxxx )* *rc\dd|jf|z}|jj|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)rvr<r rys r wm_attributeszWm.wm_attributess,$lDGG,t3ww||D!!rcR|jjdd|j|S)zVStore NAME in WM_CLIENT_MACHINE property of this widget. Return current value.rclientrurs r wm_clientz Wm.wm_clients!ww||D(DGGT::rc0t|dkDr|f}dd|jf|z}|r|jj|y|jj |jj|Dcgc]}|j |c}Scc}w)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.rrcolormapwindowsN)rrvr<r r8r)rNwlistrnrs r wm_colormapwindowszWm.wm_colormapwindowss u:>HE'1E9  GGLL "WW..tww||D/ABDB&&q)BD DDs8BcR|jjdd|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.rrrurs r wm_commandz Wm.wm_commands!ww||D)TWWe<|jjdd|y)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.rforgetNrjrws r wm_forgetz Wm.wm_forget5s  T8V,rcP|jjdd|jS)zAReturn identifier for decorative frame of this widget if present.rframerurMs r wm_framez Wm.wm_frame?sww||D'47733rcR|jjdd|j|S)ziSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.rr#ru)rN newGeometrys r wm_geometryzWm.wm_geometryEs!ww||D*dgg{CCrc v|j|jjdd|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.rr-rE)rN baseWidth baseHeightwidthInc heightIncs r wm_gridz Wm.wm_gridLs8}}TWW\\ &$'' z8Y89 9rcR|jjdd|j|S)z~Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.rgrouprurNpathNames r wm_groupz Wm.wm_groupY!ww||D'477H==rc|)|jjdd|jd|S|jjdd|j|S)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 descendants 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-defaultru)rNbitmapdefaults r wm_iconbitmapzWm.wm_iconbitmap`sF  77<<lDGGZQ Q77<<lDGGVD DrcP|jjdd|jS)zDisplay widget as icon.riconifyrurMs r wm_iconifyz Wm.wm_iconifypsww||D)TWW55rcR|jjdd|j|S)zVSet mask for the icon bitmap of this widget. Return the mask if None is given.riconmaskru)rNrs r wm_iconmaskzWm.wm_iconmaskvs!ww||D*dggv>>rcR|jjdd|j|S)zSSet the name of the icon for this widget. Return the name if None is given.riconnameru)rNnewNames r wm_iconnamezWm.wm_iconname}s!ww||D*dggw??rc|r+|jjdd|jdg|y|jjdd|jg|y)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 iconphotorNru)rNrrns r wm_iconphotozWm.wm_iconphotosG(  DGGLL{DGGZ G$ G DGGLL{DGG ;d ;rc r|j|jjdd|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 iconpositionrErGs r wm_iconpositionzWm.wm_iconpositions3}}TWW\\ .$''1a12 2rcR|jjdd|j|S)zgSet widget PATHNAME to be displayed instead of icon. Return the current value if None is given.r iconwindowrurs r wm_iconwindowzWm.wm_iconwindows!ww||D,BBrc>|jjdd|y)zThe widget specified will become a stand alone top-level window. The window will be decorated with the window managers title bar, etc.rmanageNrj)rNrs r wm_managez Wm.wm_manages  T8V,rc r|j|jjdd|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.rmaxsizerErNrrs r wm_maxsizez Wm.wm_maxsize3}}TWW\\ )TWWeV56 6rc r|j|jjdd|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.rminsizerErs r wm_minsizez Wm.wm_minsizerrcp|j|jjdd|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)rr<r rvrfs r wm_overrideredirectzWm.wm_overrideredirects4 $dggw!89 9rcR|jjdd|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 positionfromrurNwhos r wm_positionfromzWm.wm_positionfroms!ww||D.$''3??rct|r|j|}n|}|jjdd|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)rr'r<r rv)rNrrrs r wm_protocolzWm.wm_protocolsB D>nnT*GGww|| *dggtW6 6rcT|jjdd|j||S)zyInstruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.r resizablerurs r wm_resizablezWm.wm_resizables#ww||D+twwvFFrcR|jjdd|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".rsizefromrurs r wm_sizefromzWm.wm_sizefroms!ww||D*dggs;;rcR|jjdd|j|S)zQuery or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).rrru)rNnewstates r wm_statez Wm.wm_staterrcR|jjdd|j|S)zSet the title of this widget.rtitlerurs r wm_titlez Wm.wm_titlesww||D'477F;;rcR|jjdd|j|S)z_Instruct the window manager that this widget is transient with regard to widget MASTER.r transientru)rNrs r wm_transientzWm.wm_transient s!ww||D+tww??rcP|jjdd|jS)zWithdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.rrrurMs r wm_withdrawzWm.wm_withdraw sww||D*dgg66rrmrrnrl)BrPrQrRrrrrrrrrrrrrrrrrrrrrr#rr-rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!rr rrsK'+&* *F"*J; F D)O= G8 I@ J-F4 ED H%)"& 9 D> E EJ6G? H@ H<2I2 #LC J- F6G6G9+@ #L 6HG I< H> E< E@ I7 HrrcDeZdZdZdZ d dZdZdZdZdZ d Z d Z y) rzzToplevel widget of Tk which represents mostly the main window of an application. It has an associated Tcl interpreter.rGNc d|_i|_d|_d|_|Wddl}|j j tjd}|j j|\}}|dvr||z}d} tj|||| t||||_tr|jjt|r|j!tj"j$s|j'||yy)aAReturn a new top level 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 _tkloadedr<ospathbasenamerargvsplitextr8create wantobjects_debugsettrace_print_command_loadtkflagsignore_environment readprofile) rN screenNamebaseNameruseTksyncuser ext interactives r r z Tk.__init__ s     ww'' 4HGG,,X6MHc/)#c> //*h ;P[]bdhjmn  GG  ^ ,  LLNyy++   Xy 1,rcr|js+|jj|jyyr)r r<loadtkrrMs r r!z Tk.loadtk3 s%~~ GGNN  LLNrcd|_|jjd}|tjk7r t dtjd|dt |jjd}|tjk7r t dtjd|d|jg|_|jjd t|jjd t|jjd |jjd trt|a|jd |j y) NT tk_versionztk.h version (z!) doesn't match libtk.a version () tcl_versionztcl.h version (z") doesn't match libtcl.a version (tkerrorexitWM_DELETE_WINDOW)r r<rr8 TK_VERSIONr9r TCL_VERSIONrr#rrrrrrr)rNr#r%s r rz Tk._loadtk8 sWW^^L1 ,, ,"*"5"5z CD D$''..78 (.. ."*"6"6  EF F    $ "D  i2 fe,   +   ( ]%: M ($,,7rct|jjD]}|j|jj d|j tj|tr t|urda yyy)zhDestroy this and all descendants widgets. This will end the application of this Tcl interpreter.rN) rrvaluesrr<r rvrarrrNr0s r rz Tk.destroyR s_dmm**,-Aqyy{-  Y( T ]d%: M&; rcNddl}d|jvr|jd}n |j}|jj |d|z}|jj |d|z}|jj |d|z}|jj |d|z}d|i} t d| |jj |r|jjd||jj |r#t t|j| |jj |r|jjd||jj |r$t t|j| yy) 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.pyrNzfrom tkinter import *source) r environcurdirr rexecisfiler<r openread) rNrrr home class_tclclass_pybase_tclbase_pydirs r rzTk.readprofile\ s8  RZZ  6(:YYdGGLLy9'<= 77<<h&:;77<<i(&:;'',,tX%89tn $c* 77>>) $ GGLL9 - 77>>( # h$$& , 77>>( # GGLL8 , 77>>' " g##%s + #rcddl}tdtj|t_|t_|t_|t_|j|||y)zReport callback exception on sys.stderr. Applications may want to override this internal function, and should when sys.stderr is None.rNzException in Tkinter callbackfile) tracebackr,rstderrlast_exc last_type last_valuelast_tracebackprint_exception)rNrrrr@s r rzTk.report_callback_exceptionr sE  -CJJ?  !!#sB/rc.t|j|S)z3Delegate attribute access to the interpreter object)rr<)rNattrs r __getattr__zTk.__getattr__ stww%%r)NNrTFN) rPrQrRrrvr r!rrrrrIr!rr rr s6@ BAE-12: 84!,, 0&rrr>cXt|tsJt|}t||y)Nr>)rrrr,)rr?s r rr s% c5 !! ! *C #Drct||||Sr)r)rrrrs r TclrL s j(Iu 55rcreZdZdZifdZexZxZZdZeZ dZ e Z e jxZZ e jxZZy)PackzQGeometry manager Pack. Base class to use the methods pack_* in every widget.c z|jjdd|jf|j||zy)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. rrNr<r rvrrs r pack_configurezPack.pack_configure s5  {DGG, c2&' (rcR|jjdd|jy)z:Unmap this widget and do not use it for the packing order.rrNrurMs r pack_forgetzPack.pack_forget   VXtww/rct|j|jjdd|j}d|vr|j |d|d<|S)zEReturn information about the packing options for this widget.rrinrBr<r rvrrNds r pack_infozPack.pack_info M tww VVTWW E F 19''$0AdGrN)rPrQrRrrQrrrtrSrrZrrar!rr'r%r!rr rNrN sZ="$((!/.D.9v0F D!%!4!44I+++F[rrNcVeZdZdZifdZexZxZZdZeZ dZ e Z e jxZZ y)PlacezSGeometry manager Place. Base class to use the methods place_* in every widget.c z|jjdd|jf|j||zy)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 r*rNrPrs r place_configurezPlace.place_configure s5,   TWW- c2&' (rcR|jjdd|jy)Unmap this widget.r*rNrurMs r place_forgetzPlace.place_forget s  Wh0rct|j|jjdd|j}d|vr|j |d|d<|S)zEReturn information about the placing options for this widget.r*rrVrWrXs r place_infozPlace.place_info sM tww Wfdgg F G 19''$0AdGrN)rPrQrRrr_r*rrtrbrrdrrar+r%r!rr r]r] sJ>#%(4"10E0I1F D ---F\rr]ceZdZdZifdZexZxZZejxZ Z ejxZ Z dZ e ZdZdZeZej$xZZej(xZZej,xZZej0xZZej4xZZy)GridzQGeometry manager Grid. Base class to use the methods grid_* in every widget.c z|jjdd|jf|j||zy)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 r-rNrPrs r grid_configurezGrid.grid_configure s5  {DGG, c2&' (rcR|jjdd|jy)rar-rNrurMs r grid_forgetzGrid.grid_forget rTrcR|jjdd|jy)z0Unmap this widget but remember the grid options.r-r1NrurMs r grid_removezGrid.grid_remove" rTrct|j|jjdd|j}d|vr|j |d|d<|S)zSReturn information about the options for positioning this widget in a grid.r-rrVrWrXs r grid_infozGrid.grid_info& r[rN)rPrQrRrrhr-rrtrar6r1rDrArjrrlrnrrHrFrJrrMrLrPrOrRr%r!rr rfrf s= "$(&!/.D.9v~~%D9-1-F-FFO*0F0 D#111H}!%!4!44I'+'='==L$~~%D9+++F[rrfc2eZdZdZdZiidfdZdZddZy) BaseWidgetzInternal class.c| t}||_|j|_d}d|vr|d}|d=|s|jjj }|dj r|dz }|ji|_|jj|ddz}||j|<|dk(rd|}nd||fz}||_ |jdk(r d|z|_ n|jdz|z|_ i|_ |j|jjvr1|jj|jj||jj|j<y) z6Internal function. Sets up information about children.Nrr!rrz!%s%drG) rrr<rBrPrisdigitrorrrvrr)rNrr/rcounts r _setupzBaseWidget._setup9 sS >&(F )) S=v;DF >>**002DBx! %%-)+&**..tQ7!;E+0F " "4 (z $$. 99c>DjDGii#o,DG ::-- - KK  , 4 4 6+/ TZZ(rr!c|r t||f}||_|j|||jg|_|j Dcgc]\}}t |t s||f}}}|D]\}}||= |jj||jf|z|j|z|D]\}}|j||ycc}}w)zdConstruct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.N) r4 widgetNamerurr-rr(r<r rvrr) rNrrwr/roextrar2r3classess r r zBaseWidget.__init__Y s S"I&C$ FC    $ "D &)iikIkdaZ45HAq6kIDAqA   !E )DMM#,> > @DAq KKa  Js C(Ccpt|jjD]}|j|jj d|j |j|jjvr!|jj|j=tj|y)z)Destroy this and all descendants widgets.rN) rrr,rr<r rvrrrar-s r rzBaseWidget.destroyj srdmm**,-Aqyy{-  Y( ::-- - $$TZZ0 TrcV|jj|j|f|zSrru)rNrrns r _dozBaseWidget._dor s"ww||TWWdOd233rN)r!)rPrQrRrrur rr|r!rr rprp6 s#0@02b!"4rrpceZdZdZy)WidgetzxInternal class. Base class for a widget which can be positioned with the geometry managers Pack, Place or Grid.N)rPrQrRrr!rr r~r~w s  rr~ceZdZdZdifdZy)Toplevelz"Toplevel widget, e.g. for dialogs.Nc |r t||f}d}dD],}||vs||}|ddk(r d|ddz}nd|z}|||fz}||=.tj||d|i||j}|j |j |j |j |j d|jy) 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!)r]class_r rcolormaprrr7Nryr()r4rpr rrrrr) rNrr/rorxwmkeyroptrs r r zToplevel.__init__ s S"I&CE|%j9#3uSbz>SIcc *J D&*c2uEzz| dmmo& 4::<  ($,,7rrPrQrRrr r!rr rr s,"8rrc(eZdZdZdifdZdZdZy)rzButton widget.Nc 6tj||d||y)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 buttonNr~r rNrr/ros r r zButton.__init__ s& fhR8rcP|jj|jdy)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. flashNrurMs r rz Button.flash s  TWWg&rcN|jj|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. invokerurMs r rz Button.invoke sww||DGGX..r)rPrQrRrr rrr!rr rr s"9* '/rrceZdZdZdifdZdZdZdZdZddZd=dZd=dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ d Z!d!Z"d"Z#dd:Z?d;Z@y)ACanvasz?Canvas widget to display graphical elements like lines or text.Nc 6tj||d||y)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.canvasNrrs r r zCanvas.__init__ s fhR8rcX|jj|jdf|zy)raddtagNrurys r rz Canvas.addtag   dggx(4/0rc*|j|d|y)z*Add tag NEWTAG to all items above TAGORID.aboveNrrNnewtagtagOrIds r addtag_abovezCanvas.addtag_above  FGW-rc(|j|dy)zAdd tag NEWTAG to all items.rNr)rNrs r addtag_allzCanvas.addtag_all s FE"rc*|j|d|y)z*Add tag NEWTAG to all items below TAGORID.belowNrrs r addtag_belowzCanvas.addtag_below rrc0|j|d||||y)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 closest). If START is specified the next below this tag is taken.closestNr)rNrrrhalostarts r addtag_closestzCanvas.addtag_closest s FIq!T59rc0|j|d||||y)zLAdd tag NEWTAG to all items in the rectangle defined by X1,Y1,X2,Y2.enclosedNrrNrx1y1x2y2s r addtag_enclosedzCanvas.addtag_enclosed s FJBB7rc0|j|d||||y)zWAdd tag NEWTAG to all items which overlap the rectangle defined by X1,Y1,X2,Y2. overlappingNrrs r addtag_overlappingzCanvas.addtag_overlapping s FM2r2r:rc*|j|d|y)z)Add tag NEWTAG to all items with TAGORID.withtagNrrs r addtag_withtagzCanvas.addtag_withtag s FIw/rc||j|jj|jdf|zxsdS)z|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses all items with tags specified as arguments.r1NrErys r r1z Canvas.bbox s;}} GGLL$''6*T1 24<7; =*+!!!$=> >>s"A6c t|}|d}t|ttfr|dd}ni}|jj |jj |jd|g||j||zS)rrNr) r"rr'rr<rQr rvr)rNitemTypernror/s r _createzCanvas._create' s{~2h cD%= )9DCww~~ldggll GGXx.T]]3++./ /rc(|jd||S)z6Create arc shaped region with coordinates x1,y1,x2,y2.arcrrms r create_arczCanvas.create_arc3 s||E4,,rc(|jd||S)z%Create bitmap with coordinates x1,y1.rrrms r create_bitmapzCanvas.create_bitmap7 ||HdB//rc(|jd||S)z)Create image item with coordinates x1,y1.rcrrms r create_imagezCanvas.create_image; s||GT2..rc(|jd||S)z-Create line with coordinates x1,y1,...,xn,yn.rrrms r create_linezCanvas.create_line? ||FD"--rc(|jd||S)z)Create oval with coordinates x1,y1,x2,y2.ovalrrms r create_ovalzCanvas.create_ovalC rrc(|jd||S)z0Create polygon with coordinates x1,y1,...,xn,yn.polygonrrms r create_polygonzCanvas.create_polygonG s||ItR00rc(|jd||S)z.Create rectangle with coordinates x1,y1,x2,y2. rectanglerrms r create_rectanglezCanvas.create_rectangleK s||Kr22rc(|jd||S)z#Create text with coordinates x1,y1.textrrms r create_textzCanvas.create_textO rrc(|jd||S)z+Create window with coordinates x1,y1,x2,y2.rtrrms r create_windowzCanvas.create_windowS rrcX|jj|jdf|zy)zDelete characters of text items identified by tag or id in ARGS (possibly several times) from FIRST to LAST character (including).dcharsNrurys r rz Canvas.dcharsW "  dggx(4/0rcX|jj|jdf|zy)z$>rcV|jj|jdd||y)z=Set the variable end of a selection in item TAGORID to INDEX.r"toNrur$s r select_tozCanvas.select_to s  TWWhgu=rcX|jj|jd|xsdS)z$Return the type of the item TAGORID.r(Nrurs r r(z Canvas.type s"ww||DGGVW5==rrnrrE)rr) )ArPrQrRrr rrrrrrrrr1rrrrrrrrrrrrrrrrrZrrrrrrrrrrrrr=rrr  itemconfigr rrrrrrqrrrr r%r(r+r-r0r(r!rr rr sKI" 91.#.:8 ; 0< C '7 7 > /-0/..13.01 1/ : + +75 8 -77 2 G1 ; DJ 0 E/7 ,0 D704< B1@?>>rrcLeZdZdZdifdZfdZdZdZdZdZ d Z xZ S) Checkbuttonz7Checkbutton widget which is either in on- or off-state.Nc 6tj||d||y)aConstruct a checkbutton 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, offvalue, onvalue, padx, pady, relief, selectcolor, selectimage, state, takefocus, text, textvariable, underline, variable, width, wraplength. checkbuttonNrrs r r zCheckbutton.__init__  fmS"=rc|jds<|jjj}tdz ad|dt|d<t |||y)Nrrrrr7)rrBrPr_checkbutton_countsuperru)rNrr/rrBs r ruzCheckbutton._setup s[wwv>>**002D ! # dV1%7$89CK vs#rcP|jj|jdyzPut the button in off-state.deselectNrurMs r r>zCheckbutton.deselect s  TWWj)rcP|jj|jdyzFlash the button.rNrurMs r rzCheckbutton.flash"   TWWg&rcN|jj|jdSzrrr"rI __classcell__)rBs@r r5r5 s.A" > $*'/((rr5ceZdZdZdifdZddZdZdZdZdZ d Z d Z d Z e Z d ZeZd ZeZdZeZdZeZdZeZy)Entryz1Entry widget which allows displaying simple text.Nc 6tj||d||y)aConstruct an entry widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, highlightbackground, highlightcolor, highlightthickness, insertbackground, insertborderwidth, insertofftime, insertontime, insertwidth, invalidcommand, invcmd, justify, relief, selectbackground, selectborderwidth, selectforeground, show, state, takefocus, textvariable, validate, validatecommand, vcmd, width, xscrollcommand.entryNrrs r r zEntry.__init__6 s fgsB7rcT|jj|jd||y)z.Delete text from FIRST to LAST (not included).rZNrurNfirstlasts r rZz Entry.deleteC   TWWht4rcN|jj|jdS)zReturn the text.rrurMs r rz Entry.getG ww||DGGU++rcR|jj|jd|y)zInsert cursor at INDEX.rNrurNr=s r rz Entry.icursorK s  TWWi/rc|jj|jj|jd|S)zReturn position of cursor.r=rrWs r r=z Entry.indexO s1ww~~dggll GGWe%& &rcT|jj|jd||y)zInsert STRING at INDEX.rNru)rNr=rs r rz Entry.insertT s  TWWhv6rcT|jj|jdd|yrrur>s r rzEntry.scan_markX s  TWWffa0rcT|jj|jdd|y)zAdjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.rrNrur>s r r zEntry.scan_dragto\ s  TWWfh2rcT|jj|jdd|y)z9Adjust the end of the selection near the cursor to INDEX.rr#NrurWs r selection_adjustzEntry.selection_adjustb   TWWk8U;rcR|jj|jddy)r'rrNrurMs r rzEntry.selection_clearh s  TWWk73rcT|jj|jdd|y)*Set the fixed end of a selection to INDEX.rr*NrurWs r selection_fromzEntry.selection_fromn s  TWWk659rc|jj|jj|jddS)zSReturn True if there are characters selected in the entry, False otherwise.rpresentrrMs r selection_presentzEntry.selection_presentt 3ww!! GGLL+y 9; ;rcV|jj|jdd||y)3Set the selection from START to END (not included).rrangeNrurNrends r selection_rangezEntry.selection_range| s  TWWk7E3?rcT|jj|jdd|y)-Set the variable end of a selection to INDEX.rr/NrurWs r selection_tozEntry.selection_to s  TWWk47rr)rPrQrRrr rZrrr=rrr r]r%rr(rbr+reselect_presentrl select_rangeror0r!rr rLrL3 s{;" 85,0& 713 <%M4#L:!K; 'N@#L8IrrLceZdZdZdifdZy)FramezFFrame widget which may contain other widgets and can have a 3D border.Nc t||f}d}d|vr d|df}|d=nd|vr d|df}|d=tj||d|i|y)aConstruct a frame widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, highlightcolor, highlightthickness, relief, takefocus, visual, width.r!rz-classr rN)r4r~r )rNrr/rorxs r r zFrame.__init__ se b " s?s8}-EH ^s7|,EG fgsB>rrr!rr rsrs sP"?rrsceZdZdZdifdZy)Labelz0Label widget which can display text and bitmaps.Nc 6tj||d||y)aConstruct a label 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, takefocus, text, textvariable, underline, wraplength WIDGET-SPECIFIC OPTIONS height, state, width labelNrrs r r zLabel.__init__ s$ fgsB7rrr!rr rvrv s:"8rrvceZdZdZdifdZdZdZdZddZddZ d Z d Z d Z d Z d ZdZdZeZddZeZdZeZddZeZdZdZddZeZy)Listboxz3Listbox widget which can display a list of strings.Nc 6tj||d||y)aConstruct a listbox widget with the parent MASTER. Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackground, selectborderwidth, selectforeground, selectmode, setgrid, takefocus, width, xscrollcommand, yscrollcommand, listvariable.listboxNrrs r r zListbox.__init__ s fib9rcR|jj|jd|y)z"Activate item identified by INDEX.activateNrurWs r r~zListbox.activate   TWWj%0rcv|j|jj|jd|xsdS)zxReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses the item identified by the given index.r1NrErWs r r1z Listbox.bbox s-}}TWW\\$''65ABJdJrct|j|jj|jdxsdS)z.Return the indices of currently selected item. curselectionr!rErMs r rzListbox.curselection s)}}TWW\\$''>BCIrIrcT|jj|jd||y)z+Delete items from FIRST to LAST (included).rZNrurPs r rZzListbox.delete rSrc|A|jj|jj|jd||S|jj|jd|S)z0Get list of items from FIRST to LAST (included).rrrPs r rz Listbox.get sX  77$$TWW\\t&-. .77<<6 6rc|jj|jd|}|dk(ry|jj|S)z+Return index of item identified with INDEX.r=rNr<r rvrQrNr=rs r r=z Listbox.index s8 GGLL'5 1 ;tww~~a  rcZ|jj|jd|f|zy)zInsert ELEMENTS at INDEX.rNru)rNr=elementss r rzListbox.insert s"  dggx/(:;rc|jj|jj|jd|S)z5Get index of item which is nearest to y coordinate Y.nearestr)rNrs r rzListbox.nearest s1ww~~dggll GGY#$ $rcV|jj|jdd||yrrurGs r rzListbox.scan_mark rrcV|jj|jdd||y)zAdjust the view of the listbox to 10 times the difference between X and Y and the coordinates given in scan_mark.rrNrurGs r r zListbox.scan_dragto   TWWfh15rcR|jj|jd|y)z"Scroll such that INDEX is visible.seeNrurWs r rz Listbox.see   TWWeU+rcT|jj|jdd|y)z-Set the fixed end oft the selection to INDEX.rr.NrurWs r selection_anchorzListbox.selection_anchor r^rcV|jj|jdd||y)z2Clear the selection from FIRST to LAST (included).rrNrurPs r rzListbox.selection_clear s!  TWWgud 4rc|jj|jj|jdd|S)z.Return True if INDEX is part of the selection.rincludesrrWs r selection_includeszListbox.selection_includes s5ww!!$'',, GG[*e#56 6rcV|jj|jdd||y)ziSet the selection from FIRST to LAST (included) without changing the currently selected elements.rrNrurPs r selection_setzListbox.selection_set s   TWWk5%>rc|jj|jj|jdS)z-Return the number of elements in the listbox.rOrrMs r rOz Listbox.size s(ww~~dggll477F;<F!%F!3TZZ5GJ  J$6%* "J z:>2AD,,Q//q)45&&q) 3  TWWh7rcX|jj|jd|d|zS)z=Return the resource value of a menu item for OPTION at INDEX.rr7rurs r rzMenu.entrycget s#ww||DGG[%vFFrc ,|jd|f||S)zConfigure a menu item at INDEX.entryconfigurerrCs r rzMenu.entryconfigure s 0%8#rBBrc|jj|jd|}|dvrdS|jj|S)z4Return the index of a menu item identified by INDEX.r=)rrNrrs r r=z Menu.index s; GGLL'5 1L(t?dggnnQ.??rcP|jj|jd|S)zRInvoke a menu item identified by INDEX and execute the associated command.rrurWs r rz Menu.invoke sww||DGGXu55rcT|jj|jd||y)zDisplay a menu at position X,Y.postNrurGs r rz Menu.post s  TWWfa+rcP|jj|jd|S)z*Return the type of the menu item at INDEX.r(rurWs r r(z Menu.type sww||DGGVU33rcP|jj|jdy)z Unmap a menu.unpostNrurMs r rz Menu.unpost rGrc|jj|jj|jd|S)zNReturn the x-position of the leftmost pixel of the menu item at INDEX. xpositionrrWs r rzMenu.xposition s,ww~~dggll477KGHHrc|jj|jj|jd|S)zEReturn the y-position of the topmost pixel of the menu item at INDEX. ypositionrrWs r rzMenu.yposition s1ww~~dggll GG[%)* *rrr)rPrQrRrr rr~r*rrrrrrrrrrrrZrrrr=rrr(rrrr!rr rr) sZ"771!#) !'#%+!'#%+!#)+-) )+1-/5)+1-/5+-38 GC!K@ 6 ,4(I *rrceZdZdZdifdZy) Menubuttonz(Menubutton widget, obsolete since Tk8.0.Nc 6tj||d||y)N menubuttonrrs r r zMenubutton.__init__ sflCzRadiobutton.deselect s  TWWj)rcP|jj|jdyr@rurMs r rzRadiobutton.flash rArcN|jj|jdSrCrurMs r rzRadiobutton.invoke rDrcP|jj|jdyrFrurMs r r"zRadiobutton.select rGr) rPrQrRrr r>rrr"r!rr rr s#Q" >* '/(rrc6eZdZdZdifdZdZdZddZdZy) Scalez1Scale widget which can display a numerical scale.Nc 6tj||d||y)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.rNrrs r r zScale.__init__ s fgsB7rc|jj|jd} |jj|S#tt t f$r|jj|cYSwxYw)z*Get the current value as integer or float.r)r<r rvrQrr+rrRrs r rz Scale.get s] TWWe, ,77>>%( (Ix0 ,77$$U+ + ,sA/A54A5cR|jj|jd|y)zSet the value to VALUE.rNrurs r rz Scale.set rrcn|j|jj|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.rrErs r rz Scale.coords s( }}TWW\\$''8UCDDrcR|jj|jd||S)zcReturn where the point X,Y lies. Valid return values are "slider", "though1" and "though2".identifyrurGs r rzScale.identify !ww||DGGZA66rr) rPrQrRrr rrrrr!rr rr s$;" 8,,E7rrcBeZdZdZdifdZd dZdZdZdZdZ d Z y) Scrollbarz?Scrollbar widget which displays a slider at a certain position.Nc 6tj||d||y)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. scrollbarNrrs r r zScrollbar.__init__s fk3;rcX|jj|jd|xsdS)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.r~NrurWs r r~zScrollbar.activates$ww||DGGZ7?4?rc|jj|jj|jd||S)znReturn the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.rr)rNdeltaxdeltays r rzScrollbar.deltas5ww  GGLL'66 :< 2rrceZdZdZdifdZdZdZdZd8dZd8dZ d Z d9d Z d Z d8d Z d ZdZdZdZd8dZdZd8dZifdZdZdZdZd8dZdZdZdZdZdZifdZdZ d Z!d!Z"d"Z# d:d#Z$d$Z%d%Z&d8d&Z'd8d'Z(d;d(Z)d)Z*d8d*Z+e+Z,d+Z-d8d,Z.d8d-Z/d8d.Z0d8d/Z1d8d0Z2d1Z3d8d2Z4d3Z5d8d4Z6e6Z7ifd5Z8d6Z9d7Z:y)<Textz4Text widget which can display text in various forms.Nc 6tj||d||y)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, rNrrs r r z Text.__init__5s. ffc26rcv|j|jj|jd|xsdS)zReturn a tuple of (x,y,width,height) which gives the bounding box of the visible part of the character at the given index.r1NrErWs r r1z Text.bboxNs5}} TWWfe46>9= >rc |jj|jj|jd|||S)zReturn whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.comparer)rNroprs r rz Text.compareTs9ww!!$'',, GGYF#45 5rc|Dcgc]}d|z }}|||gz }|jj|jdg|xsd}|t|dkr|fS|Scc}w)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.r^rtN)r<r rvr)rNrrrnargr$s r rtz Text.countZso(,,t t,   dggll477G3d3;t ?s4yA~7NJ -s Ac|?|jj|jj|jdS|jj|jd|y)zjTurn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.Ndebugrrfs r r z Text.debugnsI ?77%%dggll477G&DE E  TWWgw/rcT|jj|jd||y)z?Delete the characters between INDEX1 and INDEX2 (not included).rZNrurNrrs r rZz Text.deleteus  TWWh7rcn|j|jj|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. dlineinforErWs r rzText.dlineinfoys(}}TWW\\$'';FGGrc g}d}d}|s g}|fd}|} t|ts|j|x}}|d|gz }|D]} || s |jd| z|j||r|j||jj |j dg|||r|j|SS#|r|j|wwxYw)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.Nc,|j|||fyr)r)rAr r=rs r append_triplez Text.dump..append_triples sE512rz-commandr7dump)rrr'rr<r rvr) rNrrrrorn func_namerrrAs r rz Text.dumps  F8> 3#G .gs+&*nnW&== G Z) )Dc7DKKc 2 KK  F# DGGLL& 04 0""9-y""9-s4CA#CCcR|jj|jdg|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 editrurys r rz Text.edits$tww||DGGV3d33rc&|jd|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. modifiedr)rNr s r edit_modifiedzText.edit_modifiedsyyS))rc$|jdS)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. redorrMs r edit_redozText.edit_redosyy  rc$|jdS)z(Clears the undo and redo stacks resetrrMs r edit_resetzText.edit_resetsyy!!rc$|jdS)znInserts a separator (boundary) on the undo stack. Does nothing when the undo option is false rrrMs r edit_separatorzText.edit_separators yy%%rc$|jdS)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 undorrMs r edit_undozText.edit_undosyy  rcR|jj|jd||S)z5Return the text from INDEX1 to INDEX2 (not included).rrurs r rzText.getsww||DGGUFF;;rc|dddk7rd|z}|dddk(r|dd}|jj|jdd||S)z9Return the value of OPTION of an embedded image at INDEX.Nrr7rrrcrrurs r image_cgetzText.image_cgetsQ "1: 6\F "#;# CR[Fww||DGGWfeVDDrc .|jdd|f||S)z%Configure an embedded image at INDEX.rcrrrCs r image_configurezText.image_configuresercV|jj|jdd||fS)zChange the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT). Return the current value if None is given for DIRECTION.rgravityru)rNmarkName directions r mark_gravityzText.mark_gravitys+ww|| WWfi9 =? ?rc|jj|jj|jddS)zReturn all mark names.rrdrrMs r mark_nameszText.mark_names s3ww   GGVW"&' 'rcV|jj|jdd||y)z0Set mark MARKNAME before the character at INDEX.rrNru)rNr4r=s r mark_setz Text.mark_sets  TWWfeXu=rcZ|jj|jddf|zy)zDelete all marks in MARKNAMES.runsetNru)rN markNamess r mark_unsetzText.mark_unsets"  dggvw/);ww   GGUK&&"BC Crc |jj|jj|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.rX prevrangerrls r tag_prevrangezText.tag_prevrangernrcV|jj|jdd||y)zaChange the priority of tag TAGNAME such that it is higher than the priority of ABOVETHIS.rXrNru)rNrYrs r rzText.tag_raises#  GGUGWi 9rc|jj|jj|jdd|S)z7Return a list of ranges of text which have tag TAGNAME.rXrangesr)rNrYs r tag_rangeszText.tag_rangess5ww   GGUHg"/0 0rcX|jj|jdd|||y)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.rXr1Nrurls r tag_removezText.tag_removes#  GGUHgvv ?rc|dddk7rd|z}|dddk(r|dd}|jj|jdd||S)z:Return the value of OPTION of an embedded window at INDEX.Nrr7rrrtrrurs r window_cgetzText.window_cgetsQ "1: 6\F "#;# CR[Fww||DGGXvufEErc .|jdd|f||S)z&Configure an embedded window at INDEX.rtrrrCs r window_configurezText.window_configures+u=sBGGrc ||jj|jdd|f|j||zy)zCreate a window at INDEX.rtrNrPrCs r window_createzText.window_creates5  ww(E2 c2&' (rc|jj|jj|jddS)z4Return all names of embedded windows in this widget.rtrdrrMs r window_nameszText.window_namess1ww  GGLL(G 46 6rcZ|jj|jddf|zy)zObsolete function, use see.rz -pickplaceNru)rNrs r yview_pickplacezText.yview_pickplaces"  dggw 5<=rrrn)NNNNNNNNrE);rPrQrRrr r1rrtr rZrrrrrr!r#r&rr)r+r-rer=rr6r8r:r>rArDrHrJrrr rrrZrrr_rarc tag_configrfr rirmrqrrurwryr{ window_configr}rrr!rr rr2sI>"72> 5 (08H %.P 4 *!" & !< EG')* 7:? ? ' >=DH,.%I G46 04047;.(,= Q '' EGJ<B : CC9 0 ? FH%M')( 6 >rrceZdZdZddZdZy)_setitz>Internal class. It wraps the command in the widget OptionMenu.Nc.||_||_||_yr) _setit__value _setit__var_setit__callback)rNvarr r$s r r z_setit.__init__s  "rc|jj|j|j|j|jg|yyr)rrrrrys r r z_setit.__call__s< t||$ ?? & DOODLL 04 0 'rrrzr!rr rrsH# 1rrc"eZdZdZdZdZdZy) OptionMenuz?OptionMenu which allows the user to select a value from a menu.c d|dtddd}tj||d|d|_t |dd x}|_|j |_|jd }d |vr|d =|r td tt|z|j|t||| |D] } |j| t|| | "||d<y )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.r6rr0) borderwidth textvariable indicatoronreliefr.highlightthicknessr tk_optionMenurr)rtearoffrzunknown option -)rxrN)RAISEDr~r rwr_OptionMenu__menurvmenunamerrr@r:rr) rNrr+r r,kwargsrorr$r3s r r zOptionMenu.__init__s &C$%' flB7)!$VQ??t{ ::i(  y! -d4<.@@A A u%:  <A   1#Ha:  <V rcP|dk(r |jStj||S)Nr)rr~rurs r ruzOptionMenu.__getitem__s& 6>;; !!$--rc<tj|d|_y)z,Destroy this widget and the associated menu.N)rrrrMs r rzOptionMenu.destroys4  rN)rPrQrRrr rurr!rr rrsI2. rrcVeZdZdZdZdidfdZdZdZdZdZ d Z e Z d Z d Z d Zy) ImagezBase class for images.rNc rd|_| td}t|d||_|s,txj dz c_dtj }|r|rt ||f}n|r|}d}|jD]\}}|d|z|fz}|jjdd||f|z||_y) Nz create imager<rpyimager!r7rcr) rrrr<r_last_idr4r-r ) rNimgtyperr/rror>r2r3s r r zImage.__init__s >&~6F&$/ NNa N"'..2D #YRy1s rIIKDAqQ *G   gx$87BC rc|jSr)rrMs r rOz Image.__str__s dii'rc|jr) |jjdd|jyy#t$rYywxYw)NrcrZ)rr<r rrMs r rz Image.__del__s? 99  Wh :   s'7 AAcZ|jj|jdd|z|yNrr7r<r rrs r rzImage.__setitem__s   TYY SWe2>rcP|jj|jdy)zDisplay a transparent image.blankNrrMs r rzPhotoImage.blankFs  TYY(rcV|jj|jdd|zS)zReturn the value of OPTION.rr7r)rNrs r rzPhotoImage.cgetJs!ww||DIIvsV|<s r rzSpinbox.scan_mark syy##rc&|jd|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>s r r zSpinbox.scan_dragtosyy1%%rc||j|jj|jdf|zxsdS)rrr!rErys r rzSpinbox.selections9}} GGLL$'';/$6 79?<> ?rc&|jd|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. r#rrWs r r]zSpinbox.selection_adjust#s~~h..rc$|jdS)zsClear the selection If the selection isn't in this widget then the command has no effect. rrrMs r rzSpinbox.selection_clear1s ~~g&&rcR|jj|jdd|S)zSets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed. rrrurs r selection_elementzSpinbox.selection_element9s! ww||DGG[)WEErc(|jd|y)rar*NrrWs r rbzSpinbox.selection_fromAs vu%rc|jj|jj|jddS)zUReturn True if there are characters selected in the spinbox, False otherwise.rrdrrMs r rezSpinbox.selection_presentErfrc*|jd||y)rhriNrrjs r rlzSpinbox.selection_rangeKs ws+rc(|jd|y)rnr/NrrWs r rozSpinbox.selection_toOs tU#rr)rPrQrRrr r1rZrrrr=rrrrr rr]rrrbrerlror!rr rrsp":: K <,775 98: $ &? /'F&; ,$rrceZdZdZdifdZy) LabelFramezlabelframe widget.Nc 6tj||d||y)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 labelframeNrrs r r zLabelFrame.__init__Ys flC B/F 7; # $ ) : )(/ 9J)XJArrct}d|jdz}|dz }t||}|jt |d|fd}|j||_t |d|j }|j|j|j|j|jy) NzThis is Tcl/Tk %s tk_patchLevelu This should be a cedilla: çrz Click me!cZ|jjd|jdzS)Nz[%s]rr)testrrs r z_test..7s) (;(; & 11)<)3r)rrQUIT) rrrvrrrrrr)rr^)rrrxrrs r _testr0s 4D !2!2?!C CD ..D $T "E JJL $["&3 4D IIKDI $VT\\ :DIIK LLNKKMNNMMOrr>r__main__)TNrrk)NNrF)gr collectionsenumrrhr8rtkinter.constantsrXrrfloatr) TkVersionr* TclVersionREADABLEWRITABLE EXCEPTIONcompilerASCIIrrr r"r*r4rB namedtuplerDr^ _simple_enumStrEnumr`rrrrrrrrrrrrGrNrTrXr^r[rQrRr rarr|rrrrArrLrNr]rfrpr~rrrr:r5rLrsrvrzrrrrrrrrrrrrrerirrrrglobalsr-rr ModuleType__all__rP)robjs00r r3s@@       (%% & 8'' (           BJJ{ # BJJy"(( + , 8!!X$##Y.S-{--.@=?S G4<< ''!'TO O d   "  q+q+h02X22EE*AA<:   =AAD(,,,??*??*mm` p&rp&f!$ ,6+,+,\0.0.f4,4,n>4>4B Zud 8z28<,/V,/^q>VUEq>h .(&.(bSFESl?F?(8F80qfeUqh~*6~*B==:f:(&(B$7F$7N/2/2dT>65%T>n 1 1$$N;7;7|QFQFh@%@3 3 m$fem$d==0}A&}AD*")!2 ,!2ID#//#&z#u?O?O/P?* !2 , z GEOt,tPN ,s*0 M2? M>,4N 2M;:M;>NN