
    #)dir                     p    d Z dZdZddlZdZdZd Zd
dZed	k    r ej	         e                       dS dS )zSummarize the information in a hex file by printing the execution
        start address (if any), and the address ranges covered by the
        data (if any), in YAML format.
z2.3.0zhexinfo: summarize a hex file's contents.
Usage:
    python hexinfo.py [options] FILE [ FILE ... ]

Options:
    -h, --help              this help message.
    -v, --version           version info.
    Nz  z- c                    t          d                    t          |                      ddlm}  ||           }|j        rt          |j                                                  }|ddgk    r|j        d         dz  |j        d         z   }n$|dgk    r|j        d         }nt          d          t          d	                    t          |                     |
                                }|rzt          d
                    t                               |D ]P}t          d                    t          t          |d         |d         dz
  |d         |d         z
                       Qt          d           d S )Nz{:s}file: '{:s}'r   )IntelHexCSIPi   EIPz#unknown 'IntelHex.start_addr' foundz{:s}entry: 0x{:08X}z	{:s}data:z?{:s}{:s}{{ first: 0x{:08X}, last: 0x{:08X}, length: 0x{:08X} }}    )printformatINLISTintelhexr   
start_addrsortedkeysRuntimeErrorINDENTsegments)fnamer   ihr   entryr   ss          [/var/www/menimich/repos/protonApp/venv/lib/python3.11/site-packages/../../../bin/hexinfo.pysummarize_yamlr   9   s   	

#
#FE
2
2333!!!!!!	%B	} ;bm((**++D;M$'%/"-2EEEEeW__M%(EEDEEE#**6599:::{{}}H Ek  (())) 	E 	EASZZ[aciklmnkoqrstquvwqwyz{|y}~  AB  C  zC  D  D  E  E  E  E	"IIIII    c                    dd l }| t          j        dd          } 	 |                    | dddg          \  }}|D ];\  }}|dv rt	          t
                      dS |dv rt	          t                      dS <n# |j        $ rs t          j                    d         }t          j	        
                    t          |          dz              t          j	        
                    t
          dz              Y dS w xY wt          |          dk     rHt          j	        
                    d	           t          j	        
                    t
          dz              dS |D ]}t          |           d S )
Nr   r   hvhelpversion)z-hz--help)z-vz	--version
z:ERROR: You should specify one or more files to summarize.
)getoptsysargv
gnu_getoptr
   USAGEVERSIONGetoptErrorexc_infostderrwritestrlenr   )r"   r    optsargsoaer   s           r   mainr1   M   s   MMM|x|&&tTFI3FGG
d 	 	CAa$$$eqq)))gqq *		    LNN1
Q%%%
t$$$qq	 4yy1}}
VWWW
t$$$q  u s   <A7 A7 5A7 7A9C43C4__main__)N)
__doc__r%   r$   r!   r   r   r   r1   __name__exit r   r   <module>r7      s   H 
 	 


		  (   < zCHTTVV r   