o
    j                     @   s0   d dl Z d dlZG dd dZG dd dZdS )    Nc                   @      e Zd Zdd Zdd ZdS )FileTargetGenc                 C   
   || _ d S N)filename)selfr    r   /root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/aiosmb/examples/scancommons/targetgens.py__init__      
zFileTargetGen.__init__c              
   C  s   zPt | jd?}|D ]2}| }|dkrqztj|ddD ]}tt t|d fV  qW q   tt |d fV  Y qW d    W d S 1 sJw   Y  W d S  tyj } zd d |fV  W Y d }~d S d }~ww )Nr Fstrict)	openr   strip	ipaddress
ip_networkstruuiduuid4	Exception)r   flineiper   r   r	   generate   s&   &
zFileTargetGen.generateN__name__
__module____qualname__r
   r   r   r   r   r	   r          r   c                   @   r   )ListTargetGenc                 C   r   r   )targets)r   r#   r   r   r	   r
      r   zListTargetGen.__init__c              
   C  s   zL| j D ]E}| }zt|}tt t|d fV  W q   ztj|ddD ]}tt t|d fV  q*W n   tt |d fV  Y Y qW d S  tyf } zd d |fV  W Y d }~d S d }~ww )NFr   )	r#   r   r   
ip_addressr   r   r   r   r   )r   targetr   r   r   r   r	   r      s(   

zListTargetGen.generateNr   r   r   r   r	   r"      r!   r"   )r   r   r   r"   r   r   r   r	   <module>   s    