mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-15 14:05:57 +00:00
update create_potfiles_in to ignore plugins build dir
This commit is contained in:
parent
15e9f5f218
commit
d1037ae213
@ -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")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user