Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: translations.py

Issue 29549604: Issue 5729 - remove_redundant_translations fails due to the presence of system file (Closed)
Patch Set: Removed Windows part Created Sept. 20, 2017, 8:47 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: translations.py
===================================================================
--- a/translations.py
+++ b/translations.py
@@ -76,16 +76,22 @@ def get_progress_for_translation_diction
return languages
def remove_redundant_translations():
default_locale_path = os.path.join(LOCALES_PATH, DEFAULT_LOCALE)
for locale in os.listdir(LOCALES_PATH):
if locale == DEFAULT_LOCALE:
continue
locale_path = os.path.join(LOCALES_PATH, locale)
+ # ignore files
+ if os.path.isfile(locale_path):
+ continue;
Vasily Kuznetsov 2017/09/22 16:27:10 You don't need the semicolon at the end of the lin
jens 2017/09/26 12:09:17 Ah, you're right. I know it's not necessary in pyt
+ # ignore hidden folders
+ if locale_path.startswith('.'):
+ continue;
if not filecmp.dircmp(locale_path, default_locale_path).diff_files:
shutil.rmtree(locale_path)
if __name__ == "__main__":
if len(sys.argv) < 3:
print_usage()
sys.exit(1)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld