File tree 2 files changed +15
-102
lines changed
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():
68
68
contents = contents .replace ('./<lang>/LC_MESSAGES/' , '' )
69
69
with open ('.tx/config' , 'w' ) as file :
70
70
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 )
71
85
72
86
73
87
def _clone_cpython_repo (version : str ):
@@ -178,7 +192,7 @@ def language_switcher(entry: ResourceLanguageStatistics) -> bool:
178
192
179
193
180
194
if __name__ == "__main__" :
181
- RUNNABLE_SCRIPTS = ('fetch' , 'recreate_tx_config' )
195
+ RUNNABLE_SCRIPTS = ('fetch' , 'recreate_tx_config' , 'warn_about_files_to_delete' )
182
196
183
197
parser = ArgumentParser ()
184
198
parser .add_argument ('cmd' , choices = RUNNABLE_SCRIPTS )
You can’t perform that action at this time.
0 commit comments