Ë °â#ÐÓ%¨+ãóL—Gd„de«ZGd„de«ZGd„de«Zd„Zy)cóR—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zy )ÚConfigNamespacea�Abstract class representing the interface of Config objects. A ConfigNamespace is a collection of names mapped to values, where the values may be nested namespaces. Values can be accessed via container notation - obj[key] - or via dotted notation - obj.key. Both these access methods are equivalent. To minimize name conflicts between namespace keys and class members, the number of class members should be minimized, and the names of all class members should start with an underscore. Subclasses must implement the methods for container-like access, and this class will automatically provide dotted access. có—t|«S©N©ÚNotImplementedError©ÚselfÚkeys ú4/usr/lib/python3.12/site-packages/iniparse/config.pyÚ_getitemzConfigNamespace._getitems €Ü" 3Ó'Ð'ócó—t||«‚rr©r r Úvalues r Ú __setitem__zConfigNamespace.__setitem__s€Ü! # uÓ-Ð-r có—t|«‚rrrs r Ú __delitem__zConfigNamespace.__delitem__s €Ü! #Ó&Ð&r có—t«Srr©r s r Ú__iter__zConfigNamespace.__iter__s €Ü"Ó$Ð$r có—t|«‚rr©r Únames r Ú_new_namespacezConfigNamespace._new_namespace s €Ü! $Ó'Ð'r cóF— |j|«y#t$rYywxYw)NFT)r ÚKeyErrorrs r Ú __contains__zConfigNamespace.__contains__#s,€ð Ø �M‰M˜#Ô ðøôò Ùð ús ‚” Ÿ có\— |j|«S#t$rt||«cYSwxYwr)r rÚ Undefinedrs r Ú __getitem__zConfigNamespace.__getitem__6s2€ð (Ø—=‘= Ó%Ð %øÜò (ܘS $Ó'Ò 'ð (ús ‚“+ª+có¬— |j|«S#t$r7|jd«r|jd«rt‚t ||«cYSwxYw)NÚ__)r rÚ startswithÚendswithÚAttributeErrorrrs r Ú __getattr__zConfigNamespace.__getattr__<sO€ð )Ø—=‘= Ó&Ð &øÜò )Ø�‰˜tÔ$¨¯©°tÔ)<Ü$Ð$ܘT 4Ó(Ò (ð )ús‚“=AÁAcó¢— tj||«tj|||«y#t$r|j ||«YywxYwr)ÚobjectÚ__getattribute__Ú __setattr__r%r)r rrs r r*zConfigNamespace.__setattr__DsH€ð *Ü × #Ñ # D¨$Ô /Ü × Ñ ˜t T¨5Õ 1øÜò *Ø × Ñ ˜T 5Ö )ð *ús‚-0°AÁ Acóž— tj||«tj||«y#t$r|j |«YywxYwr)r(r)Ú __delattr__r%rrs r r,zConfigNamespace.__delattr__KsD€ð #Ü × #Ñ # D¨$Ô /Ü × Ñ ˜t TÕ *øÜò #Ø × Ñ ˜TÖ "ð #ús‚,/¯A Á A có:—|jj|«yr)Ú__dict__Úupdate)r Ústates r Ú __setstate__zConfigNamespace.__setstate__Vs€Ø � ‰ ×јUÕ#r N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrrrr r&r*r,r1©r r rrs>„ñò$(ò.ò'ò%ò(òò&(ò )ò*ò#ó$r rcó"—eZdZdZd„Zd„Zd„Zy)raHelper class used to hold undefined names until assignment. This class helps create any undefined subsections when an assignment is made to a nested value. For example, if the statement is "cfg.a.b.c = 42", but "cfg.a.b" does not exist yet. có`—tj|d|«tj|d|«y)NrÚ namespace)r(r*)r rr9s r Ú__init__zUndefined.__init__bs&€Ü×ј4 ¨Ô.Ü×ј4 ¨iÕ8r cóX—|jj|j«}|||<yr©r9rr©r rrÚobjs r r*zUndefined.__setattr__fó#€Ø�n‰n×+Ñ+¨D¯I©IÓ6ˆØˆˆDŠ r cóX—|jj|j«}|||<yrr<r=s r rzUndefined.__setitem__jr?r N)r2r3r4r5r:r*rr6r r rrZs„ñò9òór rcóF—eZdZdZdZd„Zd„Zd„Zd„Zd„Z d d„Z d „Z d „Z y) Ú BasicConfiga‰Represents a hierarchical collection of named values. Values are added using dotted notation: >>> n = BasicConfig() >>> n.x = 7 >>> n.name.first = 'paramjit' >>> n.name.last = 'oberoi' ...and accessed the same way, or with [...]: >>> n.x 7 >>> n.name.first 'paramjit' >>> n.name.last 'oberoi' >>> n['x'] 7 >>> n['name']['first'] 'paramjit' Iterating over the namespace object returns the keys: >>> l = list(n) >>> l.sort() >>> l ['name', 'x'] Values can be deleted using 'del' and printed using 'print'. >>> n.aaa = 42 >>> del n.x >>> print(n) aaa = 42 name.first = paramjit name.last = oberoi Nested namespaces are also namespaces: >>> isinstance(n.name, ConfigNamespace) True >>> print(n.name) first = paramjit last = oberoi >>> sorted(list(n.name)) ['first', 'last'] Finally, values can be read from a file as follows: >>> from six import StringIO >>> sio = StringIO(''' ... # comment ... ui.height = 100 ... ui.width = 150 ... complexity = medium ... have_python ... data.secret.password = goodness=gracious me ... ''') >>> n = BasicConfig() >>> n._readfp(sio) >>> print(n) complexity = medium data.secret.password = goodness=gracious me have_python ui.height = 100 ui.width = 150 Ncó—i|_yr©Ú_datars r r:zBasicConfig.__init__ºs €Øˆ� r có —|j|SrrDrs r r zBasicConfig._getitem½s€Ø�z‰z˜#‰Ðr có"—||j|<yrrDrs r rzBasicConfig.__setitem__Às€Øˆ� ‰ �3Šr có—|j|=yrrDrs r rzBasicConfig.__delitem__Ãs €Ø �J‰J�s‰Or có,—t|j«Sr)ÚiterrErs r rzBasicConfig.__iter__Æs€Ü�D—J‘JÓÐr cóˆ—g}t|jj««}|j«|D]x}|j|}t |t «r'|j |j|›|›d�¬««ŒI|€|j |›|›�«Œa|j |›|›d|›�«Œzdj|«S)NÚ.)Úprefixz = Ú ) ÚlistrEÚkeysÚsortÚ isinstancerÚappendÚ__str__Újoin)r rMÚlinesrPrrs r rTzBasicConfig.__str__És�€ØˆÜ�D—J‘J—O‘OÓ%Ó&ˆØ � ‰ Œ ÛˆDØ—J‘J˜tÑ$ˆEܘ%¤Ô1Ø— ‘ ˜UŸ]™]¹VÂDÐ2I˜]ÓJÕKà�=Ø—L‘L©6±4Ð!8Õ9à—L‘L±º¹eÐ!DÕEðð�y‰y˜ÓÐr có8—t«}||j|<|Sr)rBrE)r rr>s r rzBasicConfig._new_namespaceØs€Ü‹mˆØˆ� ‰ �4ÑØˆ r có²— |j«}|sy|j«}|sŒ'|ddk(rŒ0|jdd«}t|«dk(r|}d}n&|dj«}|dj«}|jd«}|}|ddD]9}||vr"||}t |t «rŒt d|«‚|j|«}Œ;|||d<Œ×)NéÚ#Ú=érLéÿÿÿÿúvalue-namespace conflict)ÚreadlineÚstripÚsplitÚlenrRrÚ TypeErrorr) r ÚfpÚlineÚdatarrÚname_componentsÚnsÚns r Ú_readfpzBasicConfig._readfpÝsç€ØØ—;‘;“=ˆDÙØà—:‘:“<ˆDÙ˜Ø�A‰w˜#Š~˜xØ—:‘:˜c 1Ó%ˆDÜ�4‹y˜AŠ~Ø�Ø‘à˜A‘w—}‘}“�ؘQ™Ÿ ™ ›�Ø"Ÿj™j¨›oˆO؈BØ$ S bÓ)�ؘ‘7ؘA™�BÜ% b¬/Õ:Ü'Ð(BÀAÓFÐFà×*Ñ*¨1Ó-‘Bð *ð',ˆBˆ˜rÑ"Ñ #ð1r )Ú) r2r3r4r5rEr:r rrrrTrrjr6r r rBrBqs8„ñCðL €Eòòò òò ó  òó ,r rBcóÜ—t|«D]^}||}t|t«rB||vr ||}t|t«std«‚|j |«}t ||«ŒZ|||<Œ`y)aÁImports values from source into target. Recursively walks the ConfigNamespace and inserts values into the ConfigNamespace. For example: >>> n = BasicConfig() >>> n.playlist.expand_playlist = True >>> n.ui.display_clock = True >>> n.ui.display_qlength = True >>> n.ui.width = 150 >>> print(n) playlist.expand_playlist = True ui.display_clock = True ui.display_qlength = True ui.width = 150 >>> from iniparse import ini >>> i = ini.INIConfig() >>> update_config(i, n) >>> print(i) [playlist] expand_playlist = True [ui] display_clock = True display_qlength = True width = 150 r^N)ÚsortedrRrrcrÚ update_config)ÚtargetÚsourcerrÚmynss r rnrnûsn€ô<�v–ˆØ�t‘ ˆÜ �eœ_Ô -Ø�v‰~ؘd‘|�Ü! $¬Ô8Ü#Ð$>Ó?Ð?à×,Ñ,¨TÓ2�Ü ˜$ Õ &à ˆF�4ŠLñr N)r(rrrBrnr6r r Úrrs4ðôV$�fôV$ôr�ôô.E,�/ôE,óT)!r