o k`@s ddlZddlmZddZdS)N)backup_config_filecsXjdtdfdd}|d}||dO}|r*tddSdS) zChange [notification] ticket_subject_template and [notification] batch_subject_template to use syntax compatible with Jinja2. notificationz \$([\w.]+)csP|}|r&|r&d|}jd|||||dSdS)Nz${\1}z#Replaced value of [%s] %s: %s -> %sTF)getmatchsubloginfoset)name old_value new_valueconfigenvre_template_varsection4/usr/lib/python3/dist-packages/trac/upgrades/db45.pyupdate_templates   z#do_upgrade..update_templateticket_subject_templatebatch_subject_templatez .db45.bakN)rrecompilersave)rversioncursorrupdatedrr r do_upgrades    r)r trac.upgradesrrrrrrs