<s> """<STR_LIT>""" <EOL> import os <EOL> import re <EOL> import sys <EOL> proj_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) <EOL> sys . path . append ( os . path . abspath ( os . path . join ( proj_dir , '<STR_LIT:..>' , '<STR_LIT:..>' , '<STR_LIT:..>' ) ) ) <EOL> def update_translation_catalogs ( ) : <EOL> """<STR_LIT>""" <EOL> from django . core . management import call_command <EOL> prev_cwd = os . getcwd ( ) <EOL> os . chdir ( proj_dir ) <EOL> call_command ( '<STR_LIT>' ) <EOL> call_command ( '<STR_LIT>' ) <EOL> pofile = os . path . join ( proj_dir , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> with open ( pofile ) as f : <EOL> content = f . read ( ) <EOL> content = re . sub ( r'<STR_LIT>' , '<STR_LIT>' , content , flags = re . MULTILINE ) <EOL> with open ( pofile , '<STR_LIT:w>' ) as f : <EOL> f . write ( content ) <EOL> os . chdir ( prev_cwd ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> update_translation_catalogs ( ) </s>
