
    di@                         S SK r S SKJr  S SKJr  S SKJr  S SKJ	r	  SSK
Jr  SSKJrJr  SS	KJr   " S
 S\5      r " S S\5      rg)    N)	timedelta)Optional)FileSystemCache)Flask   )total_seconds)ServerSideSessionServerSideSessionInterface)Defaultsc                       \ rS rSrSrg)FileSystemSession    N)__name__
__module____qualname____firstlineno____static_attributes__r       m/var/www/fortnox.synktek.com/backend/venv/lib/python3.13/site-packages/flask_session/filesystem/filesystem.pyr   r      s    r   r   c                   T  ^  \ rS rSrSr\rSr\R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                   4S\S\S\S\S\S	\S
\S\S\4U 4S jjjrS\S\\   4S jrS\SS4S jrS\S\S\SS4S jrSrU =r$ )FileSystemSessionInterface   a?  Uses the :class:`cachelib.file.FileSystemCache` as a session storage.

:param key_prefix: A prefix that is added to storage keys.
:param use_signer: Whether to sign the session id cookie or not.
:param permanent: Whether to use permanent session or not.
:param sid_length: The length of the generated session id in bytes.
:param serialization_format: The serialization format to use for the session data.
:param cache_dir: the directory where session files are stored.
:param threshold: the maximum number of items the session stores before it
:param mode: the file mode wanted for the session files, default 0600

.. versionadded:: 0.7
    The `serialization_format` and `app` parameters were added.

.. versionadded:: 0.6
    The `sid_length` parameter was added.

.. versionadded:: 0.2
    The `use_signer` parameter was added.
Tapp
key_prefix
use_signer	permanent
sid_lengthserialization_format	cache_dir	thresholdmodec
                   > U[         R                  :w  a  [        R                  " S[        SS9  U[         R
                  :w  a  [        R                  " S[        SS9  U	[         R                  :w  a  [        R                  " S[        SS9  [        R                  " S[        SS9  [        XxU	S9U l        [        T
U ])  XX4XV5        g )Nz'SESSION_FILE_DIR' is deprecated and will be removed in a future release. Instead pass FileSystemCache(directory, threshold, mode) instance as SESSION_CACHELIB.   )
stacklevelz'SESSION_FILE_THRESHOLD' is deprecated and will be removed in a future release. Instead pass FileSystemCache(directory, threshold, mode) instance as SESSION_CLIENT.z'SESSION_FILE_MODE' is deprecated and will be removed in a future release. Instead pass FileSystemCache(directory, threshold, mode) instance as SESSION_CLIENT.z|FileSystemSessionInterface is deprecated and will be removed in a future release. Instead use the CacheLib backend directly.)r    r!   r"   )r   SESSION_FILE_DIRwarningswarnDeprecationWarningSESSION_FILE_THRESHOLDSESSION_FILE_MODEr   cachesuper__init__)selfr   r   r   r   r   r   r    r!   r"   	__class__s             r   r.   #FileSystemSessionInterface.__init__*   s     111MM s"
 777MM w"
 8---MM r" 	 K	
 %4

 	ZJ	
r   store_idreturnc                 8    U R                   R                  U5      $ N)r,   getr/   r2   s     r   _retrieve_session_data1FileSystemSessionInterface._retrieve_session_dataY   s    zz~~h''r   Nc                 :    U R                   R                  U5        g r5   )r,   deleter7   s     r   _delete_session*FileSystemSessionInterface._delete_session]   s    

(#r   session_lifetimesessionc                 f    [        U5      n[        U5      nU R                  R                  UUUS9  g )N)keyvaluetimeout)r   dictr,   set)r/   r>   r?   r2   storage_time_to_livesession_datas         r   _upsert_session*FileSystemSessionInterface._upsert_session`   s;      --=> G} 	

( 	 	
r   )r,   )r   r   r   r   __doc__r   session_classttlr   SESSION_KEY_PREFIXSESSION_USE_SIGNERSESSION_PERMANENTSESSION_ID_LENGTHSESSION_SERIALIZATION_FORMATr&   r*   r+   r   strboolintr.   r   rD   r8   r<   	TimeDeltar	   rH   r   __classcell__)r0   s   @r   r   r      s   * &M
C
 #55#66"44"44$,$I$I!22!88..-
-
 -
 	-

 -
 -
 "-
 -
 -
 -
 -
^(s (x~ ($ $ $
 )
4E
QT
	
 
r   r   )r'   datetimer   rU   typingr   cachelib.filer   flaskr   _utilsr   baser	   r
   defaultsr   r   r   r   r   r   <module>r^      s9     +  )  " @ 	) 	\
!; \
r   