Ë #Ú<9�µHãó˜—ddlmZddlZddlZddlmZddlmZddlm Z ddlm Z ddl m Z ddl mZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddlm"Z"ddlm#Z$ddlm%Z%ddlm&Z&ddlm'Z'ddlm(Z(ddlm)Z)dd l*m+Z+dd!l,m-Z-dAd"„Z.dBdCd$„Z/dDd%„Z0d#d&œdEd'„Z1dAd(„Z2dFd)„Z3dGd*„Z4dHd+„Z5dId,„Z6d#d#d-d.œ dJd/„Z7dKd0„Z8dLd1„Z9dMd2„ZdNdOd3„Z:dNdPd4„Z;dQd5„ZdTd8„Z?dUd9„Z@dVd:„ZAdWd;„ZBdXd<„ZCe d=e¬>«ZDdYd?„ZEdZd@„ZFy)[é)Ú annotationsN)ÚMapping)ÚIO)ÚIterable)ÚTypeVar)Ú parse_rfc3339)Ú Container)ÚUnexpectedCharError)ÚCUSTOM_ENCODERS©ÚAoT)ÚArray)ÚBool)ÚComment)ÚDate)ÚDateTime)Ú DottedKey)ÚEncoder)ÚFloat)Ú InlineTable)ÚInteger)ÚItem)ÚKey)Ú SingleKey)ÚString)Ú StringType)ÚTable)ÚTime)ÚTrivia©Ú Whitespace©Úitem)ÚParser©Ú TOMLDocumentcó—t|«S)zF Parses a string into a TOMLDocument. Alias for parse(). )Úparse©Ústrings ú0/usr/lib/python3.12/site-packages/tomlkit/api.pyÚloadsr,(s€ô �‹=ÐóFcóè—t|t«s&t|t«rtt |«|¬«} |j «S#t $r }dt|«›d�}t|«|‚d}~wwxYw)z- Dumps a TOMLDocument into a string. )Ú _sort_keysz%Expecting Mapping or TOML Container, z givenN) Ú isinstancer rr#ÚdictÚ as_stringÚAttributeErrorÚtypeÚ TypeError)ÚdataÚ sort_keysÚexÚmsgs r+Údumpsr:1si€ô �dœIÔ &¬:°d¼GÔ+DÜ”D˜“J¨9Ô5ˆð%ð�~‰~ÓÐøÜ ò%Ø5´d¸4³j°\ÀÐHˆÜ˜‹n "Ð$ûð%ús¸AÁ A1ÁA,Á,A1có4—t|j««S)z5 Load toml document from a file-like object. )r(Úread)Úfps r+Úloadr>As€ô �—‘“Ó Ðr-©r7có<—|jt||¬««y)z¨ Dump a TOMLDocument into a writable file stream. :param data: a dict-like object to dump :param sort_keys: if true, sort the keys in alphabetic order r?N)Úwriter:)r6r=r7s r+ÚdumprBHs€ð‡H�HŒU�4 9Ô -Õ.r-có4—t|«j«S)z7 Parses a string or bytes into a TOMLDocument. )r$r(r)s r+r(r(Rs€ô �&‹>× Ñ Ó !Ð!r-có—t«S)z. Returns a new TOMLDocument instance. r%©r-r+ÚdocumentrFYs €ô ‹>Ðr-có*—tt|««S)z/Create an integer item from a number or string.)r#Úint©Úraws r+ÚintegerrKas€ä ”�C“‹>Ðr-có*—tt|««S)z-Create an float item from a number or string.)r#ÚfloatrIs r+Úfloat_rNfs€ä ”�c“ Ó Ðr-có—t|dk(«S)z+Turn `true` or `false` into a boolean item.Útruer"rIs r+ÚbooleanrQks€ä ��v‘ Ó Ðr-T)ÚliteralÚ multilineÚescapecó\—tj||«}tj|||«S)aBCreate a string item. By default, this function will create *single line basic* strings, but boolean flags (e.g. ``literal=True`` and/or ``multiline=True``) can be used for personalization. For more information, please check the spec: ``__. Common escaping rules will be applied for basic strings. This can be controlled by explicitly setting ``escape=False``. Please note that, if you disable escaping, you will have to make sure that the given strings don't contain any forbidden character or sequence. )Ú _StringTypeÚselectrÚfrom_raw)rJrRrSrTÚtype_s r+r*r*ps)€ô( × Ñ ˜w¨ Ó 2€EÜ �?‰?˜3  vÓ .Ð.r-cóx—t|«}t|tj«s t d«‚t |«S)zCreate a TOML date.z!date() only accepts date strings.)rr0Ú _datetimeÚdateÚ ValueErrorr#©rJÚvalues r+r\r\ˆó0€ä ˜#Ó €EÜ �eœYŸ^™^Ô ,ÜÐ<Ó=Ð=ä �‹;Ðr-cóx—t|«}t|tj«s t d«‚t |«S)zCreate a TOML time.z!time() only accepts time strings.)rr0r[Útimer]r#r^s r+rbrb‘r`r-cóx—t|«}t|tj«s t d«‚t |«S)zCreate a TOML datetime.z)datetime() only accepts datetime strings.)rr0r[Údatetimer]r#r^s r+rdrdšs2€ä ˜#Ó €EÜ �eœY×/Ñ/Ô 0ÜÐDÓEÐEä �‹;Ðr-có —|€d}t|«S)zçCreate an array item for its string representation. :Example: >>> array("[1, 2, 3]") # Create from a string [1, 2, 3] >>> a = array() >>> a.extend([1, 2, 3]) # Create from a list >>> a [1, 2, 3] z[])r_rIs r+Úarrayrf£s€ð €{؈ä �‹:Ðr-có>—tt«t«d|«S)aFCreate an empty table. :param is_super_table: if true, the table is a super table :Example: >>> doc = document() >>> foo = table(True) >>> bar = table() >>> bar.update({'x': 1}) >>> foo.append('bar', bar) >>> doc.append('foo', foo) >>> print(doc.as_string()) [foo.bar] x = 1 F)rr r)Úis_super_tables r+Útableriµs€ô" ”“œf›h¨¨~Ó >Ð>r-có>—tt«t«d¬«S)z¦Create an inline table. :Example: >>> table = inline_table() >>> table.update({'x': 1, 'y': 2}) >>> print(table.as_string()) {x = 1, y = 2} T)Únew)rr rrEr-r+Ú inline_tablerlÉs€ô ”y“{¤F£H°$Ô 7Ð7r-có—tg«S)zÒCreate an array of table. :Example: >>> doc = document() >>> aot = aot() >>> aot.append(item({'x': 1})) >>> doc.append('foo', aot) >>> print(doc.as_string()) [[foo]] x = 1 r rEr-r+ÚaotrnÖs €ô ˆr‹7€Nr-có†—t|t«r t|«St|D�cgc] }t |«‘Œc}«Scc}w)aCreate a key from a string. When a list of string is given, it will create a dotted key. :Example: >>> doc = document() >>> doc.append(key('foo'), 1) >>> doc.append(key(['bar', 'baz']), 2) >>> print(doc.as_string()) foo = 1 bar.baz = 2 )r0ÚstrrrÚkey)ÚkÚ_ks r+rqrqæs9€ô�!”SÔܘ‹|ÐÜ ©Ó*© "”c˜"•g¨Ñ*Ó +Ð+ùÒ*s¥>cóž—t|«}|j«}|j«s!|jt|j ¬«‚|S)z™Parse a simple value from a string. :Example: >>> value("1") 1 >>> value("true") True >>> value("[1, 2, 3]") [1, 2, 3] )Úchar)r$Ú _parse_valueÚendÚ parse_errorr Ú_current)rJÚparserÚvs r+r_r_øsD€ô�C‹[€FØ×ÑÓ€AØ �:‰:Œ<Ø× Ñ Ô!4¸6¿?¹?Ð ÓKÐKØ €Hr-có4—t|«j«S)zkParse a key-value pair from a string. :Example: >>> key_value("foo = 1") (Key('foo'), 1) )r$Ú_parse_key_value©Úsrcs r+Ú key_valuer€ s€ô �#‹;× 'Ñ 'Ó )Ð)r-có—t|d¬«S)z"Create a whitespace from a string.T)Úfixedr r~s r+Úwsrƒs€ä �c Ô &Ð&r-có—td«S)zCreate a newline item.Ú )rƒrEr-r+Únlr†s €ä ˆd‹8€Or-có4—ttdd|z¬««S)zCreate a comment item.z z# )Ú comment_wsÚcomment)rrr)s r+r‰r‰ s€ä ”6 T°4¸&±=ÔAÓ BÐBr-ÚE)Úboundcó0—tj|«|S)zÏAdd a custom encoder, which should be a function that will be called if the value can't otherwise be converted. It should takes a single value and return a TOMLKit item or raise a ``TypeError``. )r Úappend©Úencoders r+Úregister_encoderr�(s€ô ×ј7Ô#Ø €Nr-cóŠ—tjt«5tj|«ddd«y#1swYyxYw)zUnregister a custom encoder.N)Ú contextlibÚsuppressr]r ÚremoverŽs r+Úunregister_encoderr•1s*€ä × Ñ œZÕ (Ü×јwÔ'÷ )× (Ñ (ús š9¹A)r*z str | bytesÚreturnr&)F)r6rr7Úboolr–rp)r=zIO[str] | IO[bytes]r–r&)r6rr=zIO[str]r7r—r–ÚNone)r–r&)rJz str | intr–r)rJz str | floatr–r)rJrpr–r) rJrprRr—rSr—rTr—r–r)rJrpr–r)rJrpr–r)rJrpr–r)N)rJrpr–r)rhz bool | Noner–r)r–r)r–r )rrzstr | Iterable[str]r–r)rJrpr–Ú_Item)rrpr–ztuple[Key, _Item])rrpr–r!)r–r!)r*rpr–r)r�rŠr–rŠ)r�rr–r˜)GÚ __future__rr’rdr[Úcollections.abcrÚtypingrrrÚtomlkit._utilsrÚtomlkit.containerr Útomlkit.exceptionsr Ú tomlkit.itemsr r rrrrrrrrrrrr™rrrrrVrrrr!r#Útomlkit.parserr$Útomlkit.toml_documentr&r,r:r>rBr(rFrKrNrQr*r\rbrfrirlrnrqr_r€rƒr†r‰rŠr�r•rEr-r+Úr£s8ðÝ"ãÛå#ÝÝÝå(Ý'Ý2Ý)ÝÝÝÝ!ÝÝ"Ý#Ý!ÝÝ%Ý!Ý'ÝÝ#Ý Ý3ÝÝÝ Ý$ÝÝ!Ý.óô %ó ð;@õ/ó"óóó ó ðØØñ /Ø ð/ðð/ðð /ð ð /ð  ó /ó0óóôô$?ó( 8ó ó ,ó$ ó&*ó'ó ó Cñ  ˆC�wÔ€óô(r-