§
    ôc]  ã                   óp   — d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZm	Z	m
Z
mZ dZdZdZd„ Zd	Zd
„ Zd„ ZdS )é    N)ÚArgumentParser)Úyaml)ÚconvertÚgenerateÚlegacyÚvalidatez/etc/borgmatic/configz/etc/borgmatic/excludesz/etc/borgmatic/config.yamlc            	      ó²  — t          d¬¦  «        }|                     dddt          d                     t          ¦  «        ¬¦  «         |                     dd	d
t          j                             t          ¦  «        rt          ndd¬¦  «         |                     dddt          d                     t          ¦  «        ¬¦  «         | 	                    | ¦  «        S )z‘
    Given command-line arguments with which this script was invoked, parse the arguments and return
    them as an ArgumentParser instance.
    zÆ
            Convert legacy INI-style borgmatic configuration and excludes files to a single YAML
            configuration file. Note that this replaces any comments from the source files.
        )Údescriptionz-sz--source-configÚsource_config_filenamez4Source INI-style configuration filename. Default: {})ÚdestÚdefaultÚhelpz-ez--source-excludesÚsource_excludes_filenameNzExcludes filenamez-dz--destination-configÚdestination_config_filenamez4Destination YAML configuration filename. Default: {})
r   Úadd_argumentÚDEFAULT_SOURCE_CONFIG_FILENAMEÚformatÚosÚpathÚexistsÚ DEFAULT_SOURCE_EXCLUDES_FILENAMEÚ#DEFAULT_DESTINATION_CONFIG_FILENAMEÚ
parse_args)Ú	argumentsÚparsers     úC/usr/lib/python3/dist-packages/borgmatic/commands/convert_config.pyÚparse_argumentsr      s   € õ
 ððñ ô €Fð ×ÒØØØ%Ý.ØC×JÒJÝ*ñ
ô 
ð ñ ô ð ð ×ÒØØØ'åŒ7�>Š>Õ:Ñ;Ô;ðÕ0Ð0àØ ð ñ ô ð ð ×ÒØØØ*Ý3ØC×JÒJÝ/ñ
ô 
ð ñ ô ð ð ×Ò˜YÑ'Ô'Ð'ó    éP   c                 ó¶  — t          j        d                     | j        ¦  «        t          ¦  «        }t          j        d                     | j        | j        rd                     | j        ¦  «        nd¦  «        t          ¦  «        }t          d                     |¦  «        ¦  «         t          ¦   «          t          d                     |¦  «        ¦  «         d S )NzOYour borgmatic configuration has been upgraded. Please review the result in {}.z3Once you are satisfied, you can safely delete {}{}.z and {}Ú ú
)	ÚtextwrapÚwrapr   r   ÚTEXT_WRAP_CHARACTERSr   r   ÚprintÚjoin)ÚargsÚresult_linesÚdelete_liness      r   Údisplay_resultr+   <   sË   € Ý”=ØY×`Ò`ØÔ,ñ	
ô 	
õ 	ñ	ô €Lõ ”=Ø=×DÒDØÔ'àÔ,ðˆI×Ò˜TÔ:Ñ;Ô;Ð;àñ		
ô 	
õ 	ñô €Lõ 
ˆ$�)Š)�LÑ
!Ô
!Ñ"Ô"Ð"Ý	�G„G€GÝ	ˆ$�)Š)�LÑ
!Ô
!Ñ"Ô"Ð"Ð"Ð"r   c                  ó  — 	 t          t          j        dd …         Ž } t          j        t          t          j        ¦   «         ¦  «                             ¦   «         ¦  «        }t          j
        | j        t          j        ¦  «        }t          j        | j        ¦  «        j        }| j        r8t          | j        ¦  «                             ¦   «                              ¦   «         ng }t%          j        |||¦  «        }t)          j        | j        t)          j        |¦  «        |¬¦  «         t1          | ¦  «         d S # t2          t4          f$ r:}t7          |t          j        ¬¦  «         t          j        d¦  «         Y d }~d S d }~ww xY w)Né   )Úmode)Úfile)r   ÚsysÚargvr   Úround_trip_loadÚopenr   Úschema_filenameÚreadr   Úparse_configurationr   ÚCONFIG_FORMATr   ÚstatÚst_moder   Ú
splitlinesr   Úconvert_legacy_parsed_configr   Úwrite_configurationr   Úrender_configurationr+   Ú
ValueErrorÚOSErrorr&   ÚstderrÚexit)r(   ÚschemaÚsource_configÚsource_config_file_modeÚsource_excludesÚdestination_configÚerrors          r   ÚmainrH   S   sr  € ðÝ¥¤¨¨¨¤Ð-ˆÝÔ%¥d­8Ô+CÑ+EÔ+EÑ&FÔ&F×&KÒ&KÑ&MÔ&MÑNÔNˆÝÔ2ØÔ'­Ô)=ñ
ô 
ˆõ #%¤'¨$Ô*EÑ"FÔ"FÔ"NÐð Ô,ð�D�Ô.Ñ/Ô/×4Ò4Ñ6Ô6×AÒAÑCÔCÐCàð 	õ %ÔAØ˜?¨Fñ
ô 
Ðõ 	Ô$ØÔ,ÝÔ)Ð*<Ñ=Ô=Ø(ð	
ñ 	
ô 	
ð 	
õ 	�tÑÔÐÐÐøÝ�Ð ð ð ð Ýˆe�#œ*Ð%Ñ%Ô%Ð%ÝŒ�‰Œˆˆˆˆˆˆˆøøøøðøøøs   ‚D5D9 Ä9FÅ
/E?Å?F)r   r0   r#   Úargparser   Úruamelr   Úborgmatic.configr   r   r   r   r   r   r   r   r%   r+   rH   © r   r   ú<module>rM      sº   ðØ 	€	€	€	Ø 
€
€
€
Ø €€€Ø #Ð #Ð #Ð #Ð #Ð #à Ð Ð Ð Ð Ð à @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ð @à!8Ð Ø#<Ð  Ø&BÐ #ð'(ð '(ð '(ðT Ð ð#ð #ð #ð.ð ð ð ð r   