§
    ôcÝ  ã                   óT   — d dl Z d dlmZ d dlmZ d„ Zd„ Z G d„ de¦  «        Zd„ Z	dS )	é    N)Úyaml)Úgeneratec                 ó‚   ‡— t           j                             ˆfd„|                      ¦   «         D ¦   «         ¦  «        }|S )a"  
    Given a legacy Parsed_config instance for a single section, convert it to its corresponding
    yaml.comments.CommentedMap representation in preparation for actual serialization to YAML.

    Where integer types exist in the given section schema, convert their values to integers.
    c                 ó¢   •— g | ]K\  }}|‰d                                |i ¦  «                              d¦  «        dk    rt          |¦  «        n|f‘ŒLS )Ú
propertiesÚtypeÚinteger)ÚgetÚint)Ú.0Úoption_nameÚoption_valueÚsection_schemas      €ú:/usr/lib/python3/dist-packages/borgmatic/config/convert.pyú
<listcomp>z$_convert_section.<locals>.<listcomp>   sv   ø€ ð 	
ð 	
ð 	
ñ *�˜\ð à! ,Ô/×3Ò3°KÀÑDÔD×HÒHÈÑPÔPÐT]Ò]Ð]õ �LÑ!Ô!Ð!à!ð	ð	
ð 	
ð 	
ó    )r   ÚcommentsÚCommentedMapÚitems)Úsource_section_configr   Údestination_section_configs    ` r   Ú_convert_sectionr      sZ   ø€ õ "&¤×!;Ò!;ð	
ð 	
ð 	
ð 	
ð .C×-HÒ-HÑ-JÔ-Jð	
ñ 	
ô 	
ñ
"ô 
"Ðð &Ð%r   c                 óv  ‡— t           j                             ˆfd„|                      ¦   «                              ¦   «         D ¦   «         ¦  «        }|d         }| j        d                              d¦  «        |d<   |                     d¦  «        g|d<   ||d<   | j         	                    d¦  «        r)| j        d                              d¦  «        |d	         d<   t          j        |‰¦  «         |                     ¦   «         D ]2\  }}t          j        |‰d
         |         t          j        ¬¦  «         Œ3|S )a~  
    Given a legacy Parsed_config instance loaded from an INI-style config file and a list of exclude
    patterns, convert them to a corresponding yaml.comments.CommentedMap representation in
    preparation for serialization to a single YAML config file.

    Additionally, use the given schema as a source of helpful comments to include within the
    returned CommentedMap.
    c                 óR   •— g | ]#\  }}|t          |‰d          |         ¦  «        f‘Œ$S )r   )r   )r   Úsection_nameÚsection_configÚschemas      €r   r   z0convert_legacy_parsed_config.<locals>.<listcomp>(   sH   ø€ ð 	
ð 	
ð 	
á,�˜nð Õ+¨N¸FÀ<Ô<PÐQ]Ô<^Ñ_Ô_Ð`ð	
ð 	
ð 	
r   ÚlocationÚsource_directoriesú Ú
repositoryÚrepositoriesÚexclude_patternsÚchecksÚconsistencyr   )Úindent)r   r   r   Ú_asdictr   r   ÚsplitÚpopr%   r
   r   Ú$add_comments_to_configuration_objectÚINDENT)Úsource_configÚsource_excludesr   Údestination_configr   r   r   s     `    r   Úconvert_legacy_parsed_configr/      s`  ø€ õ œ×3Ò3ð	
ð 	
ð 	
ð 	
à0=×0EÒ0EÑ0GÔ0G×0MÒ0MÑ0OÔ0Oð	
ñ 	
ô 	
ñô Ðð " *Ô-€HØ%2Ô%;Ð<PÔ%Q×%WÒ%WÐX[Ñ%\Ô%\€HÐ!Ñ"Ø (§¢¨\Ñ :Ô :Ð;€Hˆ^ÑØ#2€HÐÑ àÔ ×$Ò$ XÑ.Ô.ð eØ6CÔ6OÐPXÔ6Y×6_Ò6_Ð`cÑ6dÔ6dÐ˜=Ô)¨(Ñ3õ Ô1Ð2DÀfÑMÔMÐMà(:×(@Ò(@Ñ(BÔ(Bð 
ð 
Ñ$ˆ�nÝÔ5Ø˜F <Ô0°Ô>ÅxÄð	
ñ 	
ô 	
ð 	
ð 	
ð Ðr   c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )Ú!Legacy_configuration_not_upgradedc                 óX   •— t          t          | ¦  «                             d¦  «         d S )Na  borgmatic changed its configuration file format in version 1.1.0 from INI-style
to YAML. This better supports validation, and has a more natural way to express
lists of values. To upgrade your existing configuration, run:

    sudo upgrade-borgmatic-config

That will generate a new YAML configuration file at /etc/borgmatic/config.yaml
(by default) using the values from both your existing configuration and excludes
files. The new version of borgmatic will consume the YAML configuration file
instead of the old one.)Úsuperr1   Ú__init__)ÚselfÚ	__class__s    €r   r4   z*Legacy_configuration_not_upgraded.__init__D   s5   ø€ ÝÕ/°Ñ6Ô6×?Ò?ð	ñ	
ô 	
ð 	
ð 	
ð 	
r   )Ú__name__Ú
__module__Ú__qualname__r4   Ú__classcell__)r6   s   @r   r1   r1   C   s8   ø€ € € € € ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   r1   c                 óš   — t          d„ |D ¦   «         ¦  «        }t          j                             | ¦  «        r|st	          ¦   «         ‚dS dS )zê
    If legacy source configuration exists but no destination upgraded configs do, raise
    Legacy_configuration_not_upgraded.

    The idea is that we want to alert the user about upgrading their config if they haven't already.
    c              3   óT   K  — | ]#}t           j                             |¦  «        V — Œ$d S )N)ÚosÚpathÚexists)r   Úfilenames     r   ú	<genexpr>z/guard_configuration_upgraded.<locals>.<genexpr>Z   sA   è è € ð $ð $Ø%-�Œ�Š�xÑ Ô ð$ð $ð $ð $ð $ð $r   N)Úanyr=   r>   r?   r1   )Úsource_config_filenameÚdestination_config_filenamesÚdestination_config_existss      r   Úguard_configuration_upgradedrF   S   sq   € õ !$ð $ð $Ø1Mð$ñ $ô $ñ !ô !Ðõ 
„w‡~‚~Ð,Ñ-Ô-ð 2Ð6Oð 2Ý/Ñ1Ô1Ð1ð2ð 2ð 2ð 2r   )
r=   Úruamelr   Úborgmatic.configr   r   r/   ÚFileNotFoundErrorr1   rF   © r   r   ú<module>rK      s•   ðØ 	€	€	€	à Ð Ð Ð Ð Ð à %Ð %Ð %Ð %Ð %Ð %ð&ð &ð &ð,"ð "ð "ðJ
ð 
ð 
ð 
ð 
Ð(9ñ 
ô 
ð 
ð 2ð 2ð 2ð 2ð 2r   