
    'j                    r    d dl mZ d dlmZmZmZmZ d dlmZ d dl	m
Z
 d dlmZ erd dlmZ dddZdddZdS )    )annotations)TYPE_CHECKINGTextIOIterableOptional)is_dxf_file)dxf_file_info)ascii_tags_loader)DXFTagNstreamr   codesOptional[set[int]]returnIterable[DXFTag]c                    pt                                          d           fdt          | d          D             S )a   
    Yields comment tags from text `stream` as :class:`~ezdxf.lldxf.types.DXFTag` objects.

    Args:
        stream: input text stream
        codes: set of group codes to yield additional DXF tags e.g. {5, 0} to also yield handle and structure tags

    i  c              3  .   K   | ]}|j         v |V  d S N)code).0tagr   s     H/DATA/AppData/hermes/venv/lib/python3.11/site-packages/ezdxf/comments.py	<genexpr>zfrom_stream.<locals>.<genexpr>   s0      __CSXY^M^M^CM^M^M^M^__    F)skip_comments)setaddr
   )r   r   s    `r   from_streamr      sI     NSUUE	IIcNNN____,V5III____r   filenamestrc              #     K   t          |           rXt          |           }t          | d|j                  5 }t	          ||          E d{V  ddd           dS # 1 swxY w Y   dS t          d|  d          )a  
    Yields comment tags from file `filename` as :class:`~ezdxf.lldxf.types.DXFTag` objects.

    Args:
        filename: filename as string
        codes: yields also additional tags with specified group codes e.g. {5, 0} to also yield handle and
               structure tags

    rt)modeencoding)r   NzFile "z" is not a DXF file.)r   r	   openr#   r   IOError)r   r   infofps       r   	from_filer(      s       8 ?X&&(>>> 	4""2U3333333333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 =x===>>>s   AA!$A!r   )r   r   r   r   r   r   )r   r   r   r   r   r   )
__future__r   typingr   r   r   r   ezdxf.lldxf.validatorr   ezdxf.filemanagementr	   ezdxf.lldxf.taggerr
   ezdxf.lldxf.typesr   r   r(    r   r   <module>r0      s    # " " " " " < < < < < < < < < < < < - - - - - - . . . . . . 0 0 0 0 0 0 )((((((` ` ` ` `? ? ? ? ? ? ?r   