U
    @†6^¦  ã                   @   s$   d dl mZmZ G dd„ deƒZdS )é    )Ú
SpiderFootÚSpiderFootPluginc                   @   sD   e Zd ZdZdZdddœZddiZeƒ fdd	„Zd
d„ Z	dd„ Z
dS )Úsfp__stor_dbzYStorage::::Stores scan results into the back-end SpiderFoot database. You will need this.r   i   T)Ú
maxstorageÚ_storer   zNMaximum bytes to store for any piece of information retreived (0 = unlimited.)c                 C   s*   || _ t| ¡ ƒD ]}|| | j|< qd S )N)ÚsfÚlistÚkeysÚopts)ÚselfÚsfcÚuserOptsÚopt© r   ú7/var/www/spiderfoot.crq.systems/modules/sfp__stor_db.pyÚsetup    s    zsfp__stor_db.setupc                 C   s   dgS )NÚ*r   )r   r   r   r   ÚwatchedEvents)   s    zsfp__stor_db.watchedEventsc                 C   sˆ   | j d sd S | j d dkr`t|jƒ| j d kr`| j d|j ¡ | j |  ¡ || j d ¡ d S | j d|j ¡ | j |  ¡ |¡ d S )Nr   r   r   zStoring an event: )	r
   ÚlenÚdatar   ÚdebugÚ	eventTypeÚ__sfdb__ÚscanEventStoreÚ	getScanId)r   ÚsfEventr   r   r   ÚhandleEvent-   s    
zsfp__stor_db.handleEventN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	_priorityr
   ÚoptdescsÚdictr   r   r   r   r   r   r   r      s   þ ÿ	r   N)Úsflibr   r   r   r   r   r   r   Ú<module>   s   