
    j	                         d dl Z d dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ ej        rd dlmZ e G d d	e
                      ZdS )
    N)	dataclass)BaseSourceConnector)logger)Runner)update_download_dir_hash)SimpleNotionConfigc                   N    e Zd ZU ded<   d Zdej        e         fdZdefdZ	dS )NotionRunnerr   connector_configc                     | j         j        s| j         j        st          d          | j         j        r| j         j        rvt	          j        d                    d                    | j         j                  d                    | j         j                                                d                    }n| j         j        rEt	          j        d                    | j         j                                      d                    }n`| j         j        rEt	          j        d                    | j         j                                      d                    }nt          d          t          d| j
        |t                    | j
        _        d S )Nz%no page ids nor database ids providedz{},{},zutf-8z+could not create local cache directory namenotion)connector_nameread_confighashed_dir_namer   )r   page_idsdatabase_ids
ValueErrorhashlibsha256formatjoinencoder   r   r   download_dir)selfr   s     k/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/unstructured/ingest/runner/notion.pyupdate_read_configzNotionRunner.update_read_config   st   $- 	Fd6K6X 	FDEEE ) 	Ld.C.P 	L%nHHT2;<<HHT2?@@  &//	 OO "+ 		L%n.788??HH OO "/ 	L%n.;<<CCGLL OO JKKK(@#(+	)
 )
 )
%%%    returnc                     ddl m} |S )Nr   )NotionSourceConnector).unstructured.ingest.connector.notion.connectorr!   )r   r!   s     r   get_source_connector_clsz%NotionRunner.get_source_connector_cls/   s(    	
 	
 	
 	
 	
 	
 %$r   c                 p    |                                  } || j        | j        | j        | j                  S )N)processor_configr   r   retry_strategy_config)r#   r%   r   r   r&   )r   source_connector_clss     r   get_source_connectorz!NotionRunner.get_source_connector6   sF    #<<>>##!2!2("&"<	
 
 
 	
r   N)
__name__
__module____qualname____annotations__r   tTyper   r#   r(    r   r   r
   r
      sp         ****
 
 
:%!&1D*E % % % %
&9 
 
 
 
 
 
r   r
   )r   typingr-   dataclassesr   unstructured.ingest.interfacesr   unstructured.ingest.loggerr   &unstructured.ingest.runner.base_runnerr    unstructured.ingest.runner.utilsr   TYPE_CHECKINGr"   r   r
   r/   r   r   <module>r7      s         ! ! ! ! ! ! > > > > > > - - - - - - 9 9 9 9 9 9 E E E E E E? RQQQQQQ .
 .
 .
 .
 .
6 .
 .
 .
 .
 .
r   