§
    ƒØjž  ã                  óÂ  — d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ  ej	        d¦  «        Z
ddœd	„Zddd
dœdd„Zddd
dœdd„Zedk    rŒddlZ eej        ¦  «        dk    rvej        dd…         D ]hZe                     d¦  «        r ee¦  «         Œ#e                     d¦  «        r ee¦  «         ŒDe                     d¦  «        r ee¦  «         ŒedS dS dS )z9
Tools for compressing and decompressing musicxml files.
é    )ÚannotationsN)Úcommon)Úenvironmentzmusicxml.archiveToolsF©ÚdeleteOriginalc                óÞ   — ddl m} t                               d¦  «          |¦   «                              d¬¦  «        D ]}t          || ¬¦  «         Œt                               d¦  «         dS )	zË
    Takes all filenames in corpus.paths and runs
    :meth:`music21.musicxml.archiveTools.compressXML` on each.  If the musicXML files are
    compressed, the originals are deleted from the system.
    r   )Ú
CoreCorpuszCompressing musicXML files...)ú.xml)ÚfileExtensionsr   ztCompression complete. Run the main test suite, fix bugs if necessary,and then commit modified directories in corpus.N)Úmusic21.corpus.corporar	   ÚenvironLocalÚwarnÚgetPathsÚcompressXML)r   r	   Úfilenames      ú’/Users/tedpeters/Documents/Projects/Claude Projects/Misc Tools/notename-sheets/.venv/lib/python3.11/site-packages/music21/musicxml/archiveTools.pyÚcompressAllXMLFilesr      s�   € ð 2Ð1Ð1Ð1Ð1Ð1Ý×ÒÐ5Ñ6Ô6Ð6ð �J‘L”L×)Ò)¸Ð)ÑCÔCð =ð =ˆÝ�H¨^Ð<Ñ<Ô<Ð<Ð<Ý×Òð	:ñô ð ð ð ó    T)r   ÚsilentÚstrictMxlCheckr   ústr | pathlib.PathÚreturnÚboolc               ó„  — t          | ¦  «        } |r,|                      d¦  «        s|                      d¦  «        sdS t          j                             | d¬¦  «        }|st
                               d|› �¦  «         t          |                     d¦  «        ¦  «        }d|j        › d	�}t          j
        |d
t          j        ¬¦  «        5 }|                     | |j        ¦  «         |                     dt          j        j        z   dz   |¦  «         ddd¦  «         n# 1 swxY w Y   |r|                     ¦   «          dS )a{  
    Takes a filename, and if the filename corresponds to a musicXML file with
    an .musicxml or .xml extension, creates a corresponding compressed .mxl file in the same
    directory.

    If deleteOriginal is set to True, the original musicXML file is deleted
    from the system.

    If strictMxlCheck is False then any suffix will do.

    Returns bool if successful.
    r
   ú	.musicxmlFT©ÚreturnPathlibúUpdating file: ú.mxlzZ<?xml version="1.0" encoding="UTF-8"?>
<container>
  <rootfiles>
    <rootfile full-path="z$"/>
  </rootfiles>
</container>
    Úw©ÚcompressionúMETA-INFzcontainer.xmlN)ÚstrÚendswithr   Ú	pathToolsÚ	cleanpathr   r   Úwith_suffixÚnameÚzipfileÚZipFileÚZIP_DEFLATEDÚwriteÚwritestrÚosÚpathÚsepÚunlink)r   r   r   r   ÚfpÚnewFilenameÚ	containerÚmyZips           r   r   r   1   s“  € õ" �8‰}Œ}€HØð ˜h×/Ò/°Ñ7Ô7ð À×@QÒ@QÐR]Ñ@^Ô@^ð ØˆuÝ	Ô	×	#Ò	# H¸DÐ	#Ñ	AÔ	A€BØð 2Ý×ÒÐ0¨BÐ0Ð0Ñ1Ô1Ð1Ý�b—n’n VÑ,Ô,Ñ-Ô-€Kðð œ'ðð ð €Iõ 
ŒØØÝÔ,ð
ñ 
ô 
ð 	
ð 
Ø�Š�H˜bœgÑ&Ô&Ð&Ø�ŠØ�œœÑ$ Ñ6Øñ	
ô 	
ð 	
ð	
ð 	
ð 	
ñ 	
ô 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
øøøð 	
ð 	
ð 	
ð 	
ð ð Ø
�	Š	‰Œˆàˆ4s   ÃADÄD#Ä&D#c               óx  — t          | ¦  «        } |                      d¦  «        s|rdS t          j                             | d¬¦  «        }|st
                               d|› �¦  «         t          |j        ¦  «        }|                     d¦  «        j	        }t          j        | dt          j        ¬¦  «        5 }	 |                     ||¬	¦  «         n»# t          $ r® 	 |                     d
d¦  «        }|                     ||¬	¦  «         n|# t          $ ro d}|                     ¦   «         D ]U}	d|	v rŒ|                     |	|¬	¦  «         |s5t#          j        |¦  «        }
|
|	z  }|
|z  }|                     |¦  «         d}ŒVY nw xY wY nw xY wddd¦  «         n# 1 swxY w Y   |r|                     ¦   «          dS )a¦  
    Takes a filename, and if the filename corresponds to a compressed musicXML
    file with an .mxl extension, creates a corresponding uncompressed .musicxml file
    in the same directory.

    If deleteOriginal is set to True, the original compressed musicXML file is
    deleted from the system.

    If strictMxlCheck is False then any type of file will attempt to be extracted.

    Returns bool if successful.
    r   FTr   r   r   Úrr!   )Úmemberr0   r
   r#   N)r$   r%   r   r&   r'   r   r   Úparentr(   r)   r*   r+   r,   ÚextractÚKeyErrorÚreplaceÚnamelistÚpathlibÚPathÚrenamer2   )r   r   r   r   r3   ÚextractPathÚunarchivedNamer6   Úfound_one_fileÚ
storedNameÚextractPath_pathlibÚ	wrongNameÚcorrectNames                r   ÚuncompressMXLrI   d   s5  € õ" �8‰}Œ}€HØ×Ò˜VÑ$Ô$ð ¨ð ØˆuåÔ'×1Ò1°(È$Ð1ÑOÔO€BØð 2Ý×ÒÐ0¨BÐ0Ð0Ñ1Ô1Ð1Ý�b”i‘.”.€KØ—^’^ KÑ0Ô0Ô5€Nå	Œ˜ 3µGÔ4HÐ	IÑ	IÔ	Ið .ÈUð	.Ø�MŠM °kˆMÑBÔBÐBÐBøÝð 	.ð 	.ð 	.ð.Ø!/×!7Ò!7¸ÀÑ!LÔ!L�Ø—’ ^¸+�ÑFÔFÐFÐFøÝð .ð .ð .Ø!&�Ø"'§.¢.Ñ"2Ô"2ð 
.ð 
.�JØ! ZÐ/Ð/Ø Ø—M’M¨¸+�MÑFÔFÐFØ)ð .å.5¬l¸;Ñ.GÔ.GÐ+Ø$7¸*Ñ$D˜	Ø&9¸NÑ&J˜Ø!×(Ò(¨Ñ5Ô5Ð5Ø)-˜øð
.ð 
.ð.øøøøøð		.øøøð.ð .ð .ñ .ô .ð .ð .ð .ð .ð .ð .øøøð .ð .ð .ð .ð, ð Ø
�	Š	‰ŒˆØˆ4s[   Â8FÂ:CÃFÃ
F
Ã-DÄ
F
ÄA6FÆF
ÆFÆF
ÆFÆ	F
Æ
FÆFÆ FÚ__main__é   r
   r   r   )r   r   r   r   )Ú__doc__Ú
__future__r   r/   r?   r*   Úmusic21r   r   ÚEnvironmentr   r   r   rI   Ú__name__ÚsysÚlenÚargvÚxmlNamer%   © r   r   ú<module>rV      s¼  ððð ð #Ð "Ð "Ð "Ð "Ð "à 	€	€	€	Ø €€€Ø €€€à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð à&ˆ{Ô&Ð'>Ñ?Ô?€ð +0ð ð ð ð ð ð*  %ØØ#ð	0ð 0ð 0ð 0ð 0ð 0ðj "'ØØ!%ð	3ð 3ð 3ð 3ð 3ð 3ðl ˆzÒÐØ€J€J€JØ
€sˆ3Œ8�}„}˜ÒÐØ”x   ”|ð 	'ð 	'ˆGØ×Ò Ñ'Ô'ð 'Ø�˜GÑ$Ô$Ð$Ð$Ø×!Ò! +Ñ.Ô.ð 'Ø�˜GÑ$Ô$Ð$Ð$Ø×!Ò! &Ñ)Ô)ð 'Ø�˜gÑ&Ô&Ð&øð ÐàÐð	'ð 	'r   