
    cf                     T    d dl Z d dlZd dlZd dlZddlmZ  G d de          Zd Z	dS )    N   )corec                       e Zd ZdS )FoundN)__name__
__module____qualname__     f/home/feoh/.local/pipx/venvs/mastodon-archive/lib/python3.11/site-packages/mastodon_archive/context.pyr   r      s          r   r   c                    | j         }t          j        | j                  \  }}|dz   |z   dz   }t          j        |dd          }d}i }i }dD ]}	||	         }
| j        s!t          dt          |
          |	fz             |
D ]}|d         |d         }|d	         |v rnS|||d	         <   d
|v rD|d
         |vr|d	         g||d
         <   n'||d
                                      |d	                    |d         |d         fD ]
}||k    r|}|s/t          dt          j
                   t          j        d           |g}|d
         }||v r*||         }|                    d|           |d
         }||v *	 ||d	                  }t          |           |rQ|                    d          }|                    ||                    ||v r|                    ||                    |Qn8#  |s/t          dt          j
                   t          j        d           Y nxY w|D ]}d}|d         ||d         d         dz   z  }|d         }||d         d         d|d         d         d|d         dz  }||d         dz   z  }|t          j        |d                   z  }t          j        j                            |                    d                     dS )zQ
    Show the context of a toot: ancestors, the toot itself, and descendants
    z.user.z.jsonT)requiredquietN)statuses
favourites	bookmarksmentionszIndexing %d %s...reblogidin_reply_to_iduriurlzThe URL/URI was not found)file   r   zAThe status at the provided URL/URI had no context in your archive accountdisplay_namezboosted
z @username 
created_at
contentzutf-8)r   r   parseuserloadr   printlenappendsysstderrexitinsertpopextend	html2textstdoutbufferwriteencode)argsr   r   domainstatus_filedatafoundindexchildren
collectionr   statusuresultr   idsstrs                    r   contextrA      s   
 (CDI..Xv8#h.8K9[T4@@@DEEH# # #
 
#z 	E%X
(CCDDD 	# 	#Fh+) d|u$$ '-fTl##v--./x??>DTl^(8!9:: (8!9:AA&,OOOUmUm% # #88"E##	#.  )
;;;;WF 
	 B
++ra   $% ++uT{#c


 	)BMM%)$$$X~~

8B<(((	  	)
 	U\_\fggggHQKKK 5 5('F9%n5CDCH%F9n---9j)))<   " 	# 	ve}t##y"6)#4555
 	


7 3 344445 5s   :A0G+ +3H )
r)   os.pathosr/   rer   r   	Exceptionr   rA   r
   r   r   <module>rF      sx     


      				           I   Y5 Y5 Y5 Y5 Y5r   