update create_potfiles_in to ignore plugins build dir

This commit is contained in:
Calum Lind 2011-06-03 00:14:59 +01:00
parent 15e9f5f218
commit d1037ae213

View File

@ -1,18 +1,25 @@
#!/usr/bin/env python #!/usr/bin/env python
import os import os
import re
# Paths to exclude # Paths to exclude
EXCLUSIONS = [ EXCLUSIONS = [
"deluge/scripts" "deluge/scripts",
"deluge/i18n",
] ]
POTFILE_IN = "deluge/i18n/POTFILES.in" POTFILE_IN = "deluge/i18n/POTFILES.in"
print "Creating " + POTFILE_IN + " .." pattern = "deluge\/plugins\/.*\/build"
compiled = re.compile(pattern)
print "Creating " + POTFILE_IN + " ..."
to_translate = [] to_translate = []
for (dirpath, dirnames, filenames) in os.walk("deluge"): for (dirpath, dirnames, filenames) in os.walk("deluge"):
for filename in filenames: for filename in filenames:
if os.path.splitext(filename)[1] in (".py", ".glade") and dirpath not in EXCLUSIONS: if os.path.splitext(filename)[1] in (".py", ".glade") \
and dirpath not in EXCLUSIONS \
and not compiled.match(dirpath):
to_translate.append(os.path.join(dirpath, filename)) to_translate.append(os.path.join(dirpath, filename))
f = open(POTFILE_IN, "wb") f = open(POTFILE_IN, "wb")