File tree Expand file tree Collapse file tree 2 files changed +15
-102
lines changed
Expand file tree Collapse file tree 2 files changed +15
-102
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -68,6 +68,20 @@ def recreate_tx_config():
6868 contents = contents .replace ('./<lang>/LC_MESSAGES/' , '' )
6969 with open ('.tx/config' , 'w' ) as file :
7070 file .write (contents )
71+ warn_about_files_to_delete ()
72+
73+ def warn_about_files_to_delete ():
74+ files = list (_get_files_to_delete ())
75+ if not files :
76+ return
77+ warn (f'Found { len (files )} file(s) to delete: { ", " .join (files )} .' )
78+
79+ def _get_files_to_delete ():
80+ with open ('.tx/config' ) as config_file :
81+ config = config_file .read ()
82+ for file in Path ().rglob ('*.po' ):
83+ if os .fsdecode (file ) not in config :
84+ yield os .fsdecode (file )
7185
7286
7387def _clone_cpython_repo (version : str ):
@@ -178,7 +192,7 @@ def language_switcher(entry: ResourceLanguageStatistics) -> bool:
178192
179193
180194if __name__ == "__main__" :
181- RUNNABLE_SCRIPTS = ('fetch' , 'recreate_tx_config' )
195+ RUNNABLE_SCRIPTS = ('fetch' , 'recreate_tx_config' , 'warn_about_files_to_delete' )
182196
183197 parser = ArgumentParser ()
184198 parser .add_argument ('cmd' , choices = RUNNABLE_SCRIPTS )
You can’t perform that action at this time.
0 commit comments