+
    ¿ÌjÍ  ã                   ó\   € R t ^ RIt^ RIt^ RIt^ RItR t ! R R]4      t ! R R]4      tR# )z€

.. moduleauthor:: easygui developers and Stephen Raymond Ferg
.. default-domain:: py
.. highlight:: python

Version |release|
Nc                 ó<   € \        V 4      pVP                  4        V# ©N)ÚSettingsÚrestore)Ú	file_nameÚsettingss   & Úo/home/l0st/web/w4ttz.lol/public_html/toolz/MsgDoxxer/venv/lib/python3.14/site-packages/easygui/boxes/egstore.pyÚread_or_create_settingsr	      s   € Ü˜	Ó"€HØ×ÑÔØ€Oó    c                   óZ   a € ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tRtV tR# )ÚEgStorea$  
A class to support persistent storage.

You can use ``EgStore`` to support the storage and retrieval
of user settings for an EasyGui application.

**First: define a class named Settings as a subclass of EgStore** ::

    class Settings(EgStore):
        def __init__(self, filename):  # filename is required
            # specify default values for variables that this application wants to remember
            self.user_id = ''
            self.target_server = ''
            settings.restore()
*Second: create a persistent Settings object** ::

    settings = Settings('app_settings.txt')
    settings.user_id = 'obama_barak'
    settings.targetServer = 'whitehouse1'
    settings.store()

    # run code that gets a new value for user_id, and persist the settings
    settings.user_id = 'biden_joe'
    settings.store()

**Example C: recover the Settings instance, change an attribute, and store it again.** ::

    settings = Settings('app_settings.txt')
    settings.restore()
    print settings
    settings.user_id = 'vanrossum_g'
    settings.store()
c                ó   € Wn         R# )ztInitialize a store with the given filename.

:param filename: the file that backs this store for saving and loading
N©Úfilename©Úselfr   s   &&r   Ú__init__ÚEgStore.__init__6   s	   € ð !Žr
   c                óš   €  V P                  4        R #   \         d,   pTP                  \        P                  8w  d   h  R p?R # R p?ii ; ir   )Ú_restoreÚIOErrorÚerrnoÚENOENT)r   Úes   & r   r   ÚEgStore.restore>   s8   € ð	Ø�M‰MŽOøÜô 	Ø�w‰wœ%Ÿ,™,Ô&Øõ 'ûð	ús   ‚ ”A
Ÿ AÁA
c                óN  € \        V P                  R4      ;_uu_ 4       p\        P                  ! V4      pRRR4       XP                  P                  4        F  w  r4W@P                  V&   K  	  \        P                  P                  4       V n        R#   + '       g   i     Lf; i)a»  
Set the values of whatever attributes are recoverable
from the pickle file.

Populate the attributes (the __dict__) of the EgStore object
from the attributes (the __dict__) of the pickled object.

If the pickled object has attributes that have been initialized
in the EgStore object, then those attributes of the EgStore object
will be replaced by the values of the corresponding attributes
in the pickled object.

If the pickled object is missing some attributes that have
been initialized in the EgStore object, then those attributes
of the EgStore object will retain the values that they were
initialized with.

Where possible, the attributes will have values recovered
from the pickled object.
ÚrbN)	Úopenr   ÚpickleÚloadÚ__dict__ÚitemsÚdatetimeÚnowÚlast_time_restored)r   ÚfÚstoreÚkeyÚvalues   &    r   r   ÚEgStore._restoreF   sr   € ô* �$—-‘- ×&Ô&¨!Ü—K’K “NˆE÷ 'ð  Ÿ.™.×.Ñ.Ö0‰JˆCØ!&�M‰M˜#Óñ 1ô #+×"3Ñ"3×"7Ñ"7Ó"9ˆÖ÷ '×&ús   ŸBÂB$	c                óî   € \        V P                  R4      ;_uu_ 4       p\        P                  P                  4       V n        \
        P                  ! W4       RRR4       R#   + '       g   i     R# ; i)zZSave this store to a pickle file.
All directories in :attr:`filename` must already exist.
ÚwbN)r   r   r"   r#   Úlast_time_storedr   Údump)r   r%   s   & r   r&   ÚEgStore.stored   sI   € ô
 �$—-‘- ×&Ô&¨!Ü$,×$5Ñ$5×$9Ñ$9Ó$;ˆDÔ!Ü�KŠK˜Ô ÷ '×&×&Ò&ús   Ÿ:A#Á#A4	c                ó¨   € \         P                  P                  V P                  4      '       d#   \         P                  ! V P                  4       R# R# )z&Delete this store's file if it exists.N)ÚosÚpathÚisfiler   Úremove©r   s   &r   ÚkillÚEgStore.killn   s0   € ô �7‰7�>‰>˜$Ÿ-™-×(Ò(Ü�IŠI�d—m‘mÖ$ñ )r
   c                ó:   € V P                   P                  4       pV# )zAll attributes will be pickled )r    Úcopy©r   Ústates   & r   Ú__getstate__ÚEgStore.__getstate__t   s   € à—‘×"Ñ"Ó$ˆØˆr
   c                óP   € RV9   d   VR V P                   P                  V4       R# )z#Ensure filename won't be unpickled r   N)r    Úupdater9   s   &&r   Ú__setstate__ÚEgStore.__setstate__y   s$   € à˜ÔØ�jÐ!Ø�‰×Ñ˜UÖ#r
   c                ót  € V P                   p. p\        R V 4       4      p\        VP                  4       4       Fk  pW,          p\	        V\
        P
                  4      '       d   VP                  4       pVP                  RP                  VP                  V4      V4      4       Km  	  RP                  V4      # )z8"Format this store as "key : value" pairs, one per line.c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir   )Úlen)Ú.0r'   s   & r   Ú	<genexpr>Ú"EgStore.__str__.<locals>.<genexpr>ƒ   s   é € Ð6© ”C˜—H�H«ùs   ‚z{0} : {1!r}Ú
)r    ÚmaxÚsortedÚkeysÚ
isinstancer"   Ú	isoformatÚappendÚformatÚljustÚjoin)r   Ústored_valuesÚlinesÚwidthr'   r(   s   &     r   Ú__str__ÚEgStore.__str__   s’   € àŸ™ˆØˆÜÑ6©Ó6Ó6ˆÜ˜-×,Ñ,Ó.Ö/ˆCØ!Õ&ˆEÜ˜%¤×!2Ñ!2×3Ò3ØŸ™Ó)�Ø�L‰L˜×-Ñ-¨c¯i©i¸Ó.>ÀÓFÖGñ	 0ð
 �y‰y˜ÓÐr
   c                ób   € R P                  V P                  P                  V P                  4      # )z
{0}({1!r}))rN   Ú	__class__Ú__name__r   r4   s   &r   Ú__repr__ÚEgStore.__repr__‹   s#   € Ø×"Ñ" 4§>¡>×#:Ñ#:¸D¿M¹MÓJÐJr
   )r   r$   r,   N)rX   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r&   r5   r;   r?   rT   rY   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s?   ø‡ € ñ òD!òò:ò<!ò%òò
$ò
 ÷Kð Kr
   r   c                   ó&   a € ] tR t^�t o R tRtV tR# )r   c                ó   € Wn         R # r   r   r   s   &&r   r   ÚSettings.__init__�   s   € Ø Žr
   r   N)rX   r[   r\   r]   r   r_   r`   ra   s   @r   r   r   �   s   ø‡ € ÷!ð !r
   r   )	r^   r   r0   r   r"   r	   Úobjectr   r   © r
   r   Ú<module>rh      s:   ðñó Û 	Û Û òô
yKˆfô yKôx!ˆwö !r
   